Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | A better implementation of the moveto-neighbor optimization that checks for nearby rows on adjacent pages. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | btree-moveto-neighbor |
Files: | files | file ages | folders |
SHA1: |
2c4ecb85a475b9063aa8a3bb517ac181 |
User & Date: | drh 2017-01-21 21:47:54.621 |
Context
2017-01-23
| ||
16:56 | Optimization: Try to avoid unnecessary btree searching when repositioning a cursor to the next row. (check-in: ee793d30c1 user: drh tags: trunk) | |
2017-01-21
| ||
21:47 | A better implementation of the moveto-neighbor optimization that checks for nearby rows on adjacent pages. (Closed-Leaf check-in: 2c4ecb85a4 user: drh tags: btree-moveto-neighbor) | |
16:54 | B-tree optimization: When seeking on a rowid table that has already been positioned, check to see if the new row happens to be the next row on the same leaf page. That is a reasonably common case, and if it is true it avoids a full binary search. (check-in: 8e5cfb2039 user: drh tags: btree-moveto-neighbor) | |
Changes
Changes to src/btree.c.
︙ | ︙ | |||
5092 5093 5094 5095 5096 5097 5098 | return SQLITE_OK; } if( pCur->info.nKey<intKey ){ if( (pCur->curFlags & BTCF_AtLast)!=0 ){ *pRes = -1; return SQLITE_OK; } | | > > > | | | > > | | < | > | 5092 5093 5094 5095 5096 5097 5098 5099 5100 5101 5102 5103 5104 5105 5106 5107 5108 5109 5110 5111 5112 5113 5114 5115 5116 5117 5118 | return SQLITE_OK; } if( pCur->info.nKey<intKey ){ if( (pCur->curFlags & BTCF_AtLast)!=0 ){ *pRes = -1; return SQLITE_OK; } /* If the requested key is one more than the previous key, then ** try to get there using sqlite3BtreeNext() rather than a full ** binary search. This is an optimization only. The correct answer ** is still obtained without this ase, only a little more slowely */ if( pCur->info.nKey+1==intKey && !pCur->skipNext ){ *pRes = 0; rc = sqlite3BtreeNext(pCur, pRes); if( rc ) return rc; if( *pRes==0 ){ getCellInfo(pCur); if( pCur->info.nKey==intKey ){ return SQLITE_OK; } } } } } if( pIdxKey ){ xRecordCompare = sqlite3VdbeFindCompare(pIdxKey); |
︙ | ︙ |