SQLite

Check-in [b0d31e779e]
Login

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

Overview
Comment: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.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: b0d31e779ecf01c5a235443c05f488b177ac3045
User & Date: dan 2012-08-08 14:04:56.819
Context
2012-08-13
22:05
Refer to the WaitForSingleObjectEx and SetFilePointerEx Win32 functions only for platforms where they are going to be used. (check-in: 9888ce9294 user: mistachkin tags: trunk)
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)
Changes
Side-by-Side Diff Ignore Whitespace Patch
Changes to src/btree.c.
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996

5997
5998
5999
6000

6001

6002
6003
6004

6005

6006
6007
6008
6009
6010
6011
6012
5987
5988
5989
5990
5991
5992
5993

5994

5995
5996
5997
5998

5999
6000
6001
6002
6003

6004
6005
6006
6007
6008
6009
6010
6011
6012
6013







-

-
+



-
+

+


-
+

+







  ** way, the remainder of the function does not have to deal with any
  ** overflow cells in the parent page, since if any existed they will
  ** have already been removed.
  */
  i = pParent->nOverflow + pParent->nCell;
  if( i<2 ){
    nxDiv = 0;
    nOld = i+1;
  }else{
    nOld = 3;
    assert( bBulk==0 || bBulk==1 );
    if( iParentIdx==0 ){                 
      nxDiv = 0;
    }else if( iParentIdx==i ){
      nxDiv = i-2;
      nxDiv = i-2+bBulk;
    }else{
      assert( bBulk==0 );
      nxDiv = iParentIdx-1;
    }
    i = 2;
    i = 2-bBulk;
  }
  nOld = i+1;
  if( (i+nxDiv-pParent->nOverflow)==pParent->nCell ){
    pRight = &pParent->aData[pParent->hdrOffset+8];
  }else{
    pRight = findCell(pParent, i+nxDiv-pParent->nOverflow);
  }
  pgno = get4byte(pRight);
  while( 1 ){