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.

FossilOrigin-Name: b0d31e779ecf01c5a235443c05f488b177ac3045
This commit is contained in:
dan 2012-08-08 14:04:56 +00:00
parent f64cc49962
commit 7d6885ae8a
3 changed files with 12 additions and 11 deletions

View File

@ -1,5 +1,5 @@
C When\sbuilding\sa\sb-tree\sas\spart\sof\sa\sCREATE\sINDEX\sor\sREINDEX\sstatement,\sattempt\sto\spack\skeys\sinto\spages\sas\stightly\sas\spossible.
D 2012-08-08T11:55:15.269
C When\spopulating\san\sindex\sb-tree\sas\spart\sof\sa\sCREATE\sINDEX\sor\sREINDEX\sstatement,\sdistribute\scells\sbetween\sup\sto\sthree\ssiblings\sin\sbalance_nonroot()\sinstead\sof\sfour.\sThis\sproduces\sidentical\sdatabase\sfiles,\sbut\sis\sslightly\sfaster.
D 2012-08-08T14:04:56.819
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in abd5c10d21d1395f140d9e50ea999df8fa4d6376
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@ -123,7 +123,7 @@ F src/auth.c 523da7fb4979469955d822ff9298352d6b31de34
F src/backup.c 5b31b24d6814b11de763debf342c8cd0a15a4910
F src/bitvec.c 26675fe8e431dc555e6f2d0e11e651d172234aa1
F src/btmutex.c 976f45a12e37293e32cae0281b15a21d48a8aaa7
F src/btree.c 3a2dbf6f1b377790bed9cf1bb141f622d7b8f5eb
F src/btree.c fe84910555e103013455e21571ac8bbed23c5c50
F src/btree.h 4aee02e879211bfcfd3f551769578d2e940ab6c2
F src/btreeInt.h 4e5c2bd0f9b36b2a815a6d84f771a61a65830621
F src/build.c 0f6b40ad6211dcaba6159d0f9a297f0704f22142
@ -1010,7 +1010,7 @@ F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
F tool/warnings.sh fbc018d67fd7395f440c28f33ef0f94420226381
F tool/win/sqlite.vsix 67d8a99aceb56384a81b3f30d6c71743146d2cc9
P 1e6f5ea48174e3cb59e6d9fe1293fd87bd9c78f5
R 5b5871247315ef7c9328782279895eef
P efea62b96c6a242c8ac2bdad70e50c87aee5e871
R 086d244755cccfb12a359b31e2d04664
U dan
Z 279d19e350facc9c855651c896638780
Z 4b1b34d0b355564b0b946417aa1a7b3d

View File

@ -1 +1 @@
efea62b96c6a242c8ac2bdad70e50c87aee5e871
b0d31e779ecf01c5a235443c05f488b177ac3045

View File

@ -5991,18 +5991,19 @@ static int balance_nonroot(
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{