SQLite

Check-in [efea62b96c]
Login

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

Overview
Comment:When building a b-tree as part of a CREATE INDEX or REINDEX statement, attempt to pack keys into pages as tightly as possible.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: efea62b96c6a242c8ac2bdad70e50c87aee5e871
User & Date: dan 2012-08-08 11:55:15.269
Context
2012-08-08
14:04
When populating an index b-tree as part of a CREATE INDEX or REINDEX statement, distribute cells between up to three siblings in balance_nonroot() instead of four. This produces identical database files, but is slightly faster. (check-in: b0d31e779e user: dan tags: trunk)
11:55
When building a b-tree as part of a CREATE INDEX or REINDEX statement, attempt to pack keys into pages as tightly as possible. (check-in: efea62b96c user: dan tags: trunk)
10:14
Change to securedel2.test so that it works even if SQLITE_DEFAULT_AUTOVACUUM=1 is defined. (check-in: 1e6f5ea481 user: dan tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/btree.c.
6207
6208
6209
6210
6211
6212
6213

6214

6215
6216
6217
6218
6219
6220
6221
    int r;              /* Index of right-most cell in left sibling */
    int d;              /* Index of first cell to the left of right sibling */

    r = cntNew[i-1] - 1;
    d = r + 1 - leafData;
    assert( d<nMaxCells );
    assert( r<nMaxCells );

    while( szRight==0 || szRight+szCell[d]+2<=szLeft-(szCell[r]+2) ){

      szRight += szCell[d] + 2;
      szLeft -= szCell[r] + 2;
      cntNew[i-1]--;
      r = cntNew[i-1] - 1;
      d = r + 1 - leafData;
    }
    szNew[i] = szRight;







>
|
>







6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
    int r;              /* Index of right-most cell in left sibling */
    int d;              /* Index of first cell to the left of right sibling */

    r = cntNew[i-1] - 1;
    d = r + 1 - leafData;
    assert( d<nMaxCells );
    assert( r<nMaxCells );
    while( szRight==0 
       || (!bBulk && szRight+szCell[d]+2<=szLeft-(szCell[r]+2)) 
    ){
      szRight += szCell[d] + 2;
      szLeft -= szCell[r] + 2;
      cntNew[i-1]--;
      r = cntNew[i-1] - 1;
      d = r + 1 - leafData;
    }
    szNew[i] = szRight;