/ Check-in [42db7cd2]
Login

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

Overview
Comment:Make use of the unpacked key on the OP_IdxInsert on sorters with a LIMIT.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | unpacked-IdxInsert
Files: files | file ages | folders
SHA1: 42db7cd2c0b367f7dfe733bdaf006538937b812a
User & Date: drh 2016-11-09 01:38:56
Context
2016-11-09
16:03
Fix a simple comment typo. No changes to code. check-in: 51d0aed8 user: drh tags: unpacked-IdxInsert
01:38
Make use of the unpacked key on the OP_IdxInsert on sorters with a LIMIT. check-in: 42db7cd2 user: drh tags: unpacked-IdxInsert
01:19
Fix a typo on the OP_IdxInsert documentation. No code changes. check-in: e4acd982 user: drh tags: unpacked-IdxInsert
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/select.c.

   583    583       sqlite3VdbeJumpHere(v, addrJmp);
   584    584     }
   585    585     if( pSort->sortFlags & SORTFLAG_UseSorter ){
   586    586       op = OP_SorterInsert;
   587    587     }else{
   588    588       op = OP_IdxInsert;
   589    589     }
   590         -  sqlite3VdbeAddOp2(v, op, pSort->iECursor, regRecord);
          590  +  sqlite3VdbeAddOp4Int(v, op, pSort->iECursor, regRecord,
          591  +                       regBase+nOBSat, nBase-nOBSat);
   591    592     if( iLimit ){
   592    593       int addr;
   593    594       int r1 = 0;
   594    595       /* Fill the sorter until it contains LIMIT+OFFSET entries.  (The iLimit
   595    596       ** register is initialized with value of LIMIT+OFFSET.)  After the sorter
   596    597       ** fills up, delete the least entry in the sorter after each insert.
   597    598       ** Thus we never hold more than the LIMIT+OFFSET rows in memory at once */