/ Check-in [eac0e827]
Login

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

Overview
Comment:Avoid a few unnecessary calls to sqlite3BtreeMovetoUnpacked().
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | unpacked-IdxInsert
Files: files | file ages | folders
SHA1: eac0e827a61cfec4dd9b6d407ff398e9fda3510b
User & Date: drh 2016-11-10 20:42:08
Context
2016-11-11
17:52
Merge enhancements and bug-fixes from trunk. check-in: 5515b827 user: drh tags: unpacked-IdxInsert
2016-11-10
21:19
Break up the sqlite3BtreeMovetoUnpacked() routine into an eponymous routine and sqlite3BtreeMovetoIntkey(). Each routine specializes in a single kind of btree. Leaf check-in: 9a64a4f2 user: drh tags: split-moveto
20:42
Avoid a few unnecessary calls to sqlite3BtreeMovetoUnpacked(). check-in: eac0e827 user: drh tags: unpacked-IdxInsert
17:01
When doing a REPLACE on a WITHOUT ROWID table with no secondary indexes, bypass the OP_NoConflict/OP_Delete sequence and directly overwrite any preexisting row, for a performance increase. check-in: f7041cbb user: drh tags: unpacked-IdxInsert
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/btree.c.

  8009   8009       /* If this is an insert into a table b-tree, invalidate any incrblob 
  8010   8010       ** cursors open on the row being replaced */
  8011   8011       invalidateIncrblobCursors(p, pX->nKey, 0);
  8012   8012   
  8013   8013       /* If the cursor is currently on the last row and we are appending a
  8014   8014       ** new row onto the end, set the "loc" to avoid an unnecessary
  8015   8015       ** btreeMoveto() call */
  8016         -    if( (pCur->curFlags&BTCF_ValidNKey)!=0 && pX->nKey>0
  8017         -      && pCur->info.nKey==pX->nKey-1 ){
  8018         -       loc = -1;
         8016  +    if( (pCur->curFlags&BTCF_ValidNKey)!=0 && pX->nKey==pCur->info.nKey ){
         8017  +      loc = 0;
         8018  +    }else if( (pCur->curFlags&BTCF_ValidNKey)!=0 && pX->nKey>0
         8019  +               && pCur->info.nKey==pX->nKey-1 ){
         8020  +      loc = -1;
  8019   8021       }else if( loc==0 ){
  8020   8022         rc = sqlite3BtreeMovetoUnpacked(pCur, 0, pX->nKey, appendBias, &loc);
  8021   8023         if( rc ) return rc;
  8022   8024       }
  8023   8025     }else if( loc==0 ){
  8024   8026       if( pX->nMem ){
  8025   8027         UnpackedRecord r;