SQLite4
Check-in [414ed6da4e]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Further documentation updates.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 414ed6da4e175c29d4b27f893a3fd110fc4ca860
User & Date: dan 2012-11-13 20:16:00
Context
2012-11-14
18:23
Improvements to lsmusr.wiki. check-in: e47b5e3ae6 user: dan tags: trunk
2012-11-13
20:16
Further documentation updates. check-in: 414ed6da4e user: dan tags: trunk
18:44
Add lsmapi.wiki. And the script that generates it from lsm.h - tool/mklsmapi.tcl. check-in: 2377f4f991 user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to tool/mklsmapi.tcl.

   180    180   close $fd
   181    181   
   182    182   puts $document_preamble
   183    183   puts "<h1>LSM API Topics</h1>"
   184    184   puts <ol>
   185    185   puts $document_toc
   186    186   puts </ol>
   187         -set s "display:block;float:left;width:40ex"
          187  +set s "display:block;float:left;width:35ex"
   188    188   puts "<h1 style=clear:both>All LSM API Functions</h1>"
   189    189   foreach sym [lsort $document_functions] {
   190    190     puts "<span style=$s><a href=#$sym>$sym</a></span>"
   191    191   }
   192    192   puts "<br style=clear:both>"
   193    193   puts "<h1 style=clear:both>All LSM API Types</h1>"
   194    194   foreach sym [lsort $document_types] {

Changes to www/lsmapi.wiki.

    31     31   <li><a href="#opening" style=text-decoration:none>Opening and Closing Database Cursors</a>
    32     32   <li><a href="#positioning" style=text-decoration:none>Positioning Database Cursors</a>
    33     33   <li><a href="#extracting" style=text-decoration:none>Extracting Data From Database Cursors</a>
    34     34   <li><a href="#change" style=text-decoration:none>Change these!!</a>
    35     35   
    36     36   </ol>
    37     37   <h1 style=clear:both>All LSM API Functions</h1>
    38         -<span style=display:block;float:left;width:40ex><a href=#lsm_begin>lsm_begin</a></span>
    39         -<span style=display:block;float:left;width:40ex><a href=#lsm_checkpoint>lsm_checkpoint</a></span>
    40         -<span style=display:block;float:left;width:40ex><a href=#lsm_ckpt_size>lsm_ckpt_size</a></span>
    41         -<span style=display:block;float:left;width:40ex><a href=#lsm_close>lsm_close</a></span>
    42         -<span style=display:block;float:left;width:40ex><a href=#lsm_commit>lsm_commit</a></span>
    43         -<span style=display:block;float:left;width:40ex><a href=#lsm_config>lsm_config</a></span>
    44         -<span style=display:block;float:left;width:40ex><a href=#lsm_config_log>lsm_config_log</a></span>
    45         -<span style=display:block;float:left;width:40ex><a href=#lsm_config_work_hook>lsm_config_work_hook</a></span>
    46         -<span style=display:block;float:left;width:40ex><a href=#lsm_csr_close>lsm_csr_close</a></span>
    47         -<span style=display:block;float:left;width:40ex><a href=#lsm_csr_cmp>lsm_csr_cmp</a></span>
    48         -<span style=display:block;float:left;width:40ex><a href=#lsm_csr_first>lsm_csr_first</a></span>
    49         -<span style=display:block;float:left;width:40ex><a href=#lsm_csr_key>lsm_csr_key</a></span>
    50         -<span style=display:block;float:left;width:40ex><a href=#lsm_csr_last>lsm_csr_last</a></span>
    51         -<span style=display:block;float:left;width:40ex><a href=#lsm_csr_next>lsm_csr_next</a></span>
    52         -<span style=display:block;float:left;width:40ex><a href=#lsm_csr_open>lsm_csr_open</a></span>
    53         -<span style=display:block;float:left;width:40ex><a href=#lsm_csr_prev>lsm_csr_prev</a></span>
    54         -<span style=display:block;float:left;width:40ex><a href=#lsm_csr_seek>lsm_csr_seek</a></span>
    55         -<span style=display:block;float:left;width:40ex><a href=#lsm_csr_valid>lsm_csr_valid</a></span>
    56         -<span style=display:block;float:left;width:40ex><a href=#lsm_csr_value>lsm_csr_value</a></span>
    57         -<span style=display:block;float:left;width:40ex><a href=#lsm_delete>lsm_delete</a></span>
    58         -<span style=display:block;float:left;width:40ex><a href=#lsm_delete_range>lsm_delete_range</a></span>
    59         -<span style=display:block;float:left;width:40ex><a href=#lsm_flush>lsm_flush</a></span>
    60         -<span style=display:block;float:left;width:40ex><a href=#lsm_free>lsm_free</a></span>
    61         -<span style=display:block;float:left;width:40ex><a href=#lsm_info>lsm_info</a></span>
    62         -<span style=display:block;float:left;width:40ex><a href=#lsm_insert>lsm_insert</a></span>
    63         -<span style=display:block;float:left;width:40ex><a href=#lsm_new>lsm_new</a></span>
    64         -<span style=display:block;float:left;width:40ex><a href=#lsm_open>lsm_open</a></span>
    65         -<span style=display:block;float:left;width:40ex><a href=#lsm_rollback>lsm_rollback</a></span>
    66         -<span style=display:block;float:left;width:40ex><a href=#lsm_tree_size>lsm_tree_size</a></span>
    67         -<span style=display:block;float:left;width:40ex><a href=#lsm_work>lsm_work</a></span>
           38  +<span style=display:block;float:left;width:35ex><a href=#lsm_begin>lsm_begin</a></span>
           39  +<span style=display:block;float:left;width:35ex><a href=#lsm_checkpoint>lsm_checkpoint</a></span>
           40  +<span style=display:block;float:left;width:35ex><a href=#lsm_ckpt_size>lsm_ckpt_size</a></span>
           41  +<span style=display:block;float:left;width:35ex><a href=#lsm_close>lsm_close</a></span>
           42  +<span style=display:block;float:left;width:35ex><a href=#lsm_commit>lsm_commit</a></span>
           43  +<span style=display:block;float:left;width:35ex><a href=#lsm_config>lsm_config</a></span>
           44  +<span style=display:block;float:left;width:35ex><a href=#lsm_config_log>lsm_config_log</a></span>
           45  +<span style=display:block;float:left;width:35ex><a href=#lsm_config_work_hook>lsm_config_work_hook</a></span>
           46  +<span style=display:block;float:left;width:35ex><a href=#lsm_csr_close>lsm_csr_close</a></span>
           47  +<span style=display:block;float:left;width:35ex><a href=#lsm_csr_cmp>lsm_csr_cmp</a></span>
           48  +<span style=display:block;float:left;width:35ex><a href=#lsm_csr_first>lsm_csr_first</a></span>
           49  +<span style=display:block;float:left;width:35ex><a href=#lsm_csr_key>lsm_csr_key</a></span>
           50  +<span style=display:block;float:left;width:35ex><a href=#lsm_csr_last>lsm_csr_last</a></span>
           51  +<span style=display:block;float:left;width:35ex><a href=#lsm_csr_next>lsm_csr_next</a></span>
           52  +<span style=display:block;float:left;width:35ex><a href=#lsm_csr_open>lsm_csr_open</a></span>
           53  +<span style=display:block;float:left;width:35ex><a href=#lsm_csr_prev>lsm_csr_prev</a></span>
           54  +<span style=display:block;float:left;width:35ex><a href=#lsm_csr_seek>lsm_csr_seek</a></span>
           55  +<span style=display:block;float:left;width:35ex><a href=#lsm_csr_valid>lsm_csr_valid</a></span>
           56  +<span style=display:block;float:left;width:35ex><a href=#lsm_csr_value>lsm_csr_value</a></span>
           57  +<span style=display:block;float:left;width:35ex><a href=#lsm_delete>lsm_delete</a></span>
           58  +<span style=display:block;float:left;width:35ex><a href=#lsm_delete_range>lsm_delete_range</a></span>
           59  +<span style=display:block;float:left;width:35ex><a href=#lsm_flush>lsm_flush</a></span>
           60  +<span style=display:block;float:left;width:35ex><a href=#lsm_free>lsm_free</a></span>
           61  +<span style=display:block;float:left;width:35ex><a href=#lsm_info>lsm_info</a></span>
           62  +<span style=display:block;float:left;width:35ex><a href=#lsm_insert>lsm_insert</a></span>
           63  +<span style=display:block;float:left;width:35ex><a href=#lsm_new>lsm_new</a></span>
           64  +<span style=display:block;float:left;width:35ex><a href=#lsm_open>lsm_open</a></span>
           65  +<span style=display:block;float:left;width:35ex><a href=#lsm_rollback>lsm_rollback</a></span>
           66  +<span style=display:block;float:left;width:35ex><a href=#lsm_tree_size>lsm_tree_size</a></span>
           67  +<span style=display:block;float:left;width:35ex><a href=#lsm_work>lsm_work</a></span>
    68     68   <br style=clear:both>
    69     69   <h1 style=clear:both>All LSM API Types</h1>
    70         -<span style=display:block;float:left;width:40ex><a href=#lsm_compress>lsm_compress</a></span>
           70  +<span style=display:block;float:left;width:35ex><a href=#lsm_compress>lsm_compress</a></span>
    71     71   <br style=clear:both>
    72     72   <h1>All LSM API Constants</h1>
    73         -<span style=display:block;float:left;width:40ex><a href=#LSM_BUSY>LSM_BUSY</a></span>
    74         -<span style=display:block;float:left;width:40ex><a href=#LSM_CANTOPEN>LSM_CANTOPEN</a></span>
    75         -<span style=display:block;float:left;width:40ex><a href=#LSM_CONFIG_AUTOCHECKPOINT>LSM_CONFIG_AUTOCHECKPOINT</a></span>
    76         -<span style=display:block;float:left;width:40ex><a href=#LSM_CONFIG_AUTOWORK>LSM_CONFIG_AUTOWORK</a></span>
    77         -<span style=display:block;float:left;width:40ex><a href=#LSM_CONFIG_BLOCK_SIZE>LSM_CONFIG_BLOCK_SIZE</a></span>
    78         -<span style=display:block;float:left;width:40ex><a href=#LSM_CONFIG_GET_COMPRESSION>LSM_CONFIG_GET_COMPRESSION</a></span>
    79         -<span style=display:block;float:left;width:40ex><a href=#LSM_CONFIG_LOG_SIZE>LSM_CONFIG_LOG_SIZE</a></span>
    80         -<span style=display:block;float:left;width:40ex><a href=#LSM_CONFIG_MAX_FREELIST>LSM_CONFIG_MAX_FREELIST</a></span>
    81         -<span style=display:block;float:left;width:40ex><a href=#LSM_CONFIG_MMAP>LSM_CONFIG_MMAP</a></span>
    82         -<span style=display:block;float:left;width:40ex><a href=#LSM_CONFIG_MULTIPLE_PROCESSES>LSM_CONFIG_MULTIPLE_PROCESSES</a></span>
    83         -<span style=display:block;float:left;width:40ex><a href=#LSM_CONFIG_NMERGE>LSM_CONFIG_NMERGE</a></span>
    84         -<span style=display:block;float:left;width:40ex><a href=#LSM_CONFIG_PAGE_SIZE>LSM_CONFIG_PAGE_SIZE</a></span>
    85         -<span style=display:block;float:left;width:40ex><a href=#LSM_CONFIG_SAFETY>LSM_CONFIG_SAFETY</a></span>
    86         -<span style=display:block;float:left;width:40ex><a href=#LSM_CONFIG_SET_COMPRESSION>LSM_CONFIG_SET_COMPRESSION</a></span>
    87         -<span style=display:block;float:left;width:40ex><a href=#LSM_CONFIG_USE_LOG>LSM_CONFIG_USE_LOG</a></span>
    88         -<span style=display:block;float:left;width:40ex><a href=#LSM_CONFIG_WRITE_BUFFER>LSM_CONFIG_WRITE_BUFFER</a></span>
    89         -<span style=display:block;float:left;width:40ex><a href=#LSM_CORRUPT>LSM_CORRUPT</a></span>
    90         -<span style=display:block;float:left;width:40ex><a href=#LSM_ERROR>LSM_ERROR</a></span>
    91         -<span style=display:block;float:left;width:40ex><a href=#LSM_FULL>LSM_FULL</a></span>
    92         -<span style=display:block;float:left;width:40ex><a href=#LSM_INFO_ARRAY_PAGES>LSM_INFO_ARRAY_PAGES</a></span>
    93         -<span style=display:block;float:left;width:40ex><a href=#LSM_INFO_ARRAY_STRUCTURE>LSM_INFO_ARRAY_STRUCTURE</a></span>
    94         -<span style=display:block;float:left;width:40ex><a href=#LSM_INFO_DB_STRUCTURE>LSM_INFO_DB_STRUCTURE</a></span>
    95         -<span style=display:block;float:left;width:40ex><a href=#LSM_INFO_FREELIST>LSM_INFO_FREELIST</a></span>
    96         -<span style=display:block;float:left;width:40ex><a href=#LSM_INFO_LOG_STRUCTURE>LSM_INFO_LOG_STRUCTURE</a></span>
    97         -<span style=display:block;float:left;width:40ex><a href=#LSM_INFO_NREAD>LSM_INFO_NREAD</a></span>
    98         -<span style=display:block;float:left;width:40ex><a href=#LSM_INFO_NWRITE>LSM_INFO_NWRITE</a></span>
    99         -<span style=display:block;float:left;width:40ex><a href=#LSM_INFO_PAGE_ASCII_DUMP>LSM_INFO_PAGE_ASCII_DUMP</a></span>
   100         -<span style=display:block;float:left;width:40ex><a href=#LSM_INFO_PAGE_HEX_DUMP>LSM_INFO_PAGE_HEX_DUMP</a></span>
   101         -<span style=display:block;float:left;width:40ex><a href=#LSM_IOERR>LSM_IOERR</a></span>
   102         -<span style=display:block;float:left;width:40ex><a href=#LSM_MISUSE>LSM_MISUSE</a></span>
   103         -<span style=display:block;float:left;width:40ex><a href=#LSM_NOMEM>LSM_NOMEM</a></span>
   104         -<span style=display:block;float:left;width:40ex><a href=#LSM_OK>LSM_OK</a></span>
   105         -<span style=display:block;float:left;width:40ex><a href=#LSM_PROTOCOL>LSM_PROTOCOL</a></span>
   106         -<span style=display:block;float:left;width:40ex><a href=#LSM_SAFETY_FULL>LSM_SAFETY_FULL</a></span>
   107         -<span style=display:block;float:left;width:40ex><a href=#LSM_SAFETY_NORMAL>LSM_SAFETY_NORMAL</a></span>
   108         -<span style=display:block;float:left;width:40ex><a href=#LSM_SAFETY_OFF>LSM_SAFETY_OFF</a></span>
   109         -<span style=display:block;float:left;width:40ex><a href=#LSM_SEEK_EQ>LSM_SEEK_EQ</a></span>
   110         -<span style=display:block;float:left;width:40ex><a href=#LSM_SEEK_GE>LSM_SEEK_GE</a></span>
   111         -<span style=display:block;float:left;width:40ex><a href=#LSM_SEEK_LE>LSM_SEEK_LE</a></span>
   112         -<span style=display:block;float:left;width:40ex><a href=#LSM_SEEK_LEFAST>LSM_SEEK_LEFAST</a></span>
           73  +<span style=display:block;float:left;width:35ex><a href=#LSM_BUSY>LSM_BUSY</a></span>
           74  +<span style=display:block;float:left;width:35ex><a href=#LSM_CANTOPEN>LSM_CANTOPEN</a></span>
           75  +<span style=display:block;float:left;width:35ex><a href=#LSM_CONFIG_AUTOCHECKPOINT>LSM_CONFIG_AUTOCHECKPOINT</a></span>
           76  +<span style=display:block;float:left;width:35ex><a href=#LSM_CONFIG_AUTOWORK>LSM_CONFIG_AUTOWORK</a></span>
           77  +<span style=display:block;float:left;width:35ex><a href=#LSM_CONFIG_BLOCK_SIZE>LSM_CONFIG_BLOCK_SIZE</a></span>
           78  +<span style=display:block;float:left;width:35ex><a href=#LSM_CONFIG_GET_COMPRESSION>LSM_CONFIG_GET_COMPRESSION</a></span>
           79  +<span style=display:block;float:left;width:35ex><a href=#LSM_CONFIG_LOG_SIZE>LSM_CONFIG_LOG_SIZE</a></span>
           80  +<span style=display:block;float:left;width:35ex><a href=#LSM_CONFIG_MAX_FREELIST>LSM_CONFIG_MAX_FREELIST</a></span>
           81  +<span style=display:block;float:left;width:35ex><a href=#LSM_CONFIG_MMAP>LSM_CONFIG_MMAP</a></span>
           82  +<span style=display:block;float:left;width:35ex><a href=#LSM_CONFIG_MULTIPLE_PROCESSES>LSM_CONFIG_MULTIPLE_PROCESSES</a></span>
           83  +<span style=display:block;float:left;width:35ex><a href=#LSM_CONFIG_NMERGE>LSM_CONFIG_NMERGE</a></span>
           84  +<span style=display:block;float:left;width:35ex><a href=#LSM_CONFIG_PAGE_SIZE>LSM_CONFIG_PAGE_SIZE</a></span>
           85  +<span style=display:block;float:left;width:35ex><a href=#LSM_CONFIG_SAFETY>LSM_CONFIG_SAFETY</a></span>
           86  +<span style=display:block;float:left;width:35ex><a href=#LSM_CONFIG_SET_COMPRESSION>LSM_CONFIG_SET_COMPRESSION</a></span>
           87  +<span style=display:block;float:left;width:35ex><a href=#LSM_CONFIG_USE_LOG>LSM_CONFIG_USE_LOG</a></span>
           88  +<span style=display:block;float:left;width:35ex><a href=#LSM_CONFIG_WRITE_BUFFER>LSM_CONFIG_WRITE_BUFFER</a></span>
           89  +<span style=display:block;float:left;width:35ex><a href=#LSM_CORRUPT>LSM_CORRUPT</a></span>
           90  +<span style=display:block;float:left;width:35ex><a href=#LSM_ERROR>LSM_ERROR</a></span>
           91  +<span style=display:block;float:left;width:35ex><a href=#LSM_FULL>LSM_FULL</a></span>
           92  +<span style=display:block;float:left;width:35ex><a href=#LSM_INFO_ARRAY_PAGES>LSM_INFO_ARRAY_PAGES</a></span>
           93  +<span style=display:block;float:left;width:35ex><a href=#LSM_INFO_ARRAY_STRUCTURE>LSM_INFO_ARRAY_STRUCTURE</a></span>
           94  +<span style=display:block;float:left;width:35ex><a href=#LSM_INFO_DB_STRUCTURE>LSM_INFO_DB_STRUCTURE</a></span>
           95  +<span style=display:block;float:left;width:35ex><a href=#LSM_INFO_FREELIST>LSM_INFO_FREELIST</a></span>
           96  +<span style=display:block;float:left;width:35ex><a href=#LSM_INFO_LOG_STRUCTURE>LSM_INFO_LOG_STRUCTURE</a></span>
           97  +<span style=display:block;float:left;width:35ex><a href=#LSM_INFO_NREAD>LSM_INFO_NREAD</a></span>
           98  +<span style=display:block;float:left;width:35ex><a href=#LSM_INFO_NWRITE>LSM_INFO_NWRITE</a></span>
           99  +<span style=display:block;float:left;width:35ex><a href=#LSM_INFO_PAGE_ASCII_DUMP>LSM_INFO_PAGE_ASCII_DUMP</a></span>
          100  +<span style=display:block;float:left;width:35ex><a href=#LSM_INFO_PAGE_HEX_DUMP>LSM_INFO_PAGE_HEX_DUMP</a></span>
          101  +<span style=display:block;float:left;width:35ex><a href=#LSM_IOERR>LSM_IOERR</a></span>
          102  +<span style=display:block;float:left;width:35ex><a href=#LSM_MISUSE>LSM_MISUSE</a></span>
          103  +<span style=display:block;float:left;width:35ex><a href=#LSM_NOMEM>LSM_NOMEM</a></span>
          104  +<span style=display:block;float:left;width:35ex><a href=#LSM_OK>LSM_OK</a></span>
          105  +<span style=display:block;float:left;width:35ex><a href=#LSM_PROTOCOL>LSM_PROTOCOL</a></span>
          106  +<span style=display:block;float:left;width:35ex><a href=#LSM_SAFETY_FULL>LSM_SAFETY_FULL</a></span>
          107  +<span style=display:block;float:left;width:35ex><a href=#LSM_SAFETY_NORMAL>LSM_SAFETY_NORMAL</a></span>
          108  +<span style=display:block;float:left;width:35ex><a href=#LSM_SAFETY_OFF>LSM_SAFETY_OFF</a></span>
          109  +<span style=display:block;float:left;width:35ex><a href=#LSM_SEEK_EQ>LSM_SEEK_EQ</a></span>
          110  +<span style=display:block;float:left;width:35ex><a href=#LSM_SEEK_GE>LSM_SEEK_GE</a></span>
          111  +<span style=display:block;float:left;width:35ex><a href=#LSM_SEEK_LE>LSM_SEEK_LE</a></span>
          112  +<span style=display:block;float:left;width:35ex><a href=#LSM_SEEK_LEFAST>LSM_SEEK_LEFAST</a></span>
   113    113   <br style=clear:both>
   114    114   <h2 id=lsm>LSM Error Codes<a id=LSM_OK></a><a id=LSM_ERROR></a><a id=LSM_BUSY></a><a id=LSM_NOMEM></a><a id=LSM_IOERR></a><a id=LSM_CORRUPT></a><a id=LSM_FULL></a><a id=LSM_CANTOPEN></a><a id=LSM_PROTOCOL></a><a id=LSM_MISUSE></a></h2>
   115    115   <verbatim>#define LSM_OK         0
   116    116   #define LSM_ERROR      1
   117    117   #define LSM_BUSY       5
   118    118   #define LSM_NOMEM      7
   119    119   #define LSM_IOERR     10

Changes to www/lsmusr.wiki.

    69     69   it is perhaps more accurate to say that an LSM database is stored on disk
    70     70   in a single database file and a single (optional) log file.
    71     71   
    72     72   <p>If required, it is possible to configure LSM to use external data
    73     73   compression and/or encryption functions to transform data before it is
    74     74   stored in the database file.
    75     75   
    76         -<p><i>Say something about the difference in performance characteristics 
    77         -between a b-tree and whatever it is LSM is. Link the performance graphs page.
    78         -</i>
           76  +<p>Many database systems that support range queries, including <a
           77  +href=http://www.sqlite.org>SQLite 3</a>, Berkeley DB and Kyoto Cabinet, are
           78  +based on a <a href="http://en.wikipedia.org/wiki/B-tree">b-tree data
           79  +structure</a> or variant thereof. A b-tree structure minimizes the number of
           80  +disk sectors that must be read from disk when searching the database for a
           81  +specific key. However, b-tree implementations usually suffer from poor write
           82  +localization - updating the contents of a b-tree often involves modifying the
           83  +contents of nodes scattered throughout the database file. If the database is
           84  +stored on a spinning disk (HDD), then the disk heads must be moved before
           85  +writing non-contiguous sector, which is extremely slow. If the database is
           86  +stored on solid state storage (SDD) a similar phenomena is encountered due 
           87  +to the large erase-block sizes. In general, writing to a series of contiguous
           88  +disk sectors is orders of magnitude faster than updating to the same number
           89  +of disk sectors scattered randomly throughout a large file. Additionally,
           90  +b-tree structures are prone to fragmentation, reducing the speed of range
           91  +queries.
           92  +
           93  +<p><i>Todo: Should have references for the claims above.</i>
           94  +
           95  +<p><i>Also, fix the link in the next paragraph to point to something more
           96  +specific.</i>
           97  +
           98  +<p>LSM uses a <a href=lsm.wiki>different data structure</a> that makes the
           99  +following performance tradeoffs relative to a b-tree:
          100  +
          101  +<ul>
          102  +  <li> A very large percentage of the disk sectors modified are contiguous.
          103  +       Additionally, in many cases the total number of sectors written
          104  +       to disk is reduced. This makes writing to an LSM database much
          105  +       faster than the equivalent b-tree.
          106  +
          107  +  <li> LSM databases do not suffer from fragmentation to the same degree
          108  +       as b-trees. This means that the performance of large range queries 
          109  +       does not degrade as the database is updated as it may with a b-tree.
          110  +
          111  +  <li> It is accepted that under some circumstances searching an LSM 
          112  +       database for a given key will involve examining more disk sectors
          113  +       than it would with a b-tree. In this sense both b-trees and LSM
          114  +       provide O(log(N)) efficiency, but the base of the logarithm is 
          115  +       generally larger for a b-tree than for LSM.
          116  +</ul>
          117  +
          118  +<p>In other words, all things considered equal, writing to an LSM database
          119  +should be very fast and scanning through large ranges of keys should also
          120  +perform well, but searching the database for specific keys may be slightly
          121  +slower than when using a b-tree based system. Additionally, avoiding random
          122  +writes in favour of largely contiguous updates can significantly reduce the
          123  +wear on SSD or flash memory devices.
          124  +
          125  +<p>Although it has quite different features to LSM in other respects, 
          126  +LevelDB makes similar performance tradeoffs.
          127  +
          128  +<p>Benchmark test results for LSM are available here. <i>Todo: Link to a page
          129  +with performance graphs here</i>
          130  +
    79    131   
    80    132   <h1 id=using_lsm_in_applications>2. Using LSM in Applications </h1>
    81    133   
    82    134   <p>LSM is not currently built or distributed independently. Instead, it
    83    135   is part of the SQLite4 library. To use LSM in an application, the application
    84    136   links against libsqlite4 and includes the header file "lsm.h" in any files
    85    137   that access the LSM API.