mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-07 02:42:48 +03:00
More optimizations to sqlite3BtreeMovetoUnpacked(). But there are failures
in TH3. Committing this intermediate state to facilitate bisecting. FossilOrigin-Name: f80497be446f84d2000e454e32d717887a7d0cee
This commit is contained in:
12
manifest
12
manifest
@@ -1,5 +1,5 @@
|
||||
C More\simprovements\sto\ssqlite3BtreeMovetoUnpacked()\sperformance.
|
||||
D 2013-11-25T14:10:15.692
|
||||
C More\soptimizations\sto\ssqlite3BtreeMovetoUnpacked().\s\sBut\sthere\sare\sfailures\nin\sTH3.\s\sCommitting\sthis\sintermediate\sstate\sto\sfacilitate\sbisecting.
|
||||
D 2013-11-25T15:01:38.218
|
||||
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
|
||||
F Makefile.in e1a9b4258bbde53f5636f4e238c65b7e11459e2b
|
||||
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
|
||||
@@ -166,7 +166,7 @@ F src/auth.c 523da7fb4979469955d822ff9298352d6b31de34
|
||||
F src/backup.c 1809a7caa2504233bdddd12f5018422421789537
|
||||
F src/bitvec.c 19a4ba637bd85f8f63fc8c9bae5ade9fb05ec1cb
|
||||
F src/btmutex.c 976f45a12e37293e32cae0281b15a21d48a8aaa7
|
||||
F src/btree.c c300cb68948a03f0049addddd9e36f28551e78ae
|
||||
F src/btree.c 7459c164e26b1dca39d439186a4cf8328e0ffb1f
|
||||
F src/btree.h a61ddebc78c66795a2b93181321a116746302cc9
|
||||
F src/btreeInt.h f038e818bfadf75afbd09819ed93c26a333d39e0
|
||||
F src/build.c 07054d45319953e54a89d726e589a423e9c1c590
|
||||
@@ -1142,7 +1142,7 @@ F tool/vdbe-compress.tcl f12c884766bd14277f4fcedcae07078011717381
|
||||
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
|
||||
F tool/warnings.sh d1a6de74685f360ab718efda6265994b99bbea01
|
||||
F tool/win/sqlite.vsix 030f3eeaf2cb811a3692ab9c14d021a75ce41fff
|
||||
P d0fb7acea7cbfe6f2d84782a28bb51675a06576f
|
||||
R 29c1330ebdfb45d969bc6dbf6661ccf0
|
||||
P 88680698231b7141401f7166e3aff8dbc6008030
|
||||
R a02e2482a947ddc5fc2d75dda36e99fc
|
||||
U drh
|
||||
Z d111eff6e7e1e09087be24d32976d9d6
|
||||
Z 1dd2b4d4fc066dfd776d99dd8b11e059
|
||||
|
@@ -1 +1 @@
|
||||
88680698231b7141401f7166e3aff8dbc6008030
|
||||
f80497be446f84d2000e454e32d717887a7d0cee
|
36
src/btree.c
36
src/btree.c
@@ -4662,7 +4662,7 @@ int sqlite3BtreeMovetoUnpacked(
|
||||
assert( pPage->intKey==(pIdxKey==0) );
|
||||
lwr = 0;
|
||||
upr = pPage->nCell-1;
|
||||
idx = biasRight ? upr : (upr+lwr)/2;
|
||||
idx = biasRight ? upr : upr/2;
|
||||
pCur->aiIdx[pCur->iPage] = (u16)idx;
|
||||
pCur->info.nSize = 0;
|
||||
if( pPage->intKey ){
|
||||
@@ -4674,28 +4674,26 @@ int sqlite3BtreeMovetoUnpacked(
|
||||
pCell += getVarint32(pCell, dummy);
|
||||
}
|
||||
getVarint(pCell, (u64*)&nCellKey);
|
||||
if( nCellKey==intKey ){
|
||||
if( nCellKey<intKey ){
|
||||
lwr = idx+1;
|
||||
if( lwr>upr ){ c = -1; break; }
|
||||
}else if( nCellKey>intKey ){
|
||||
upr = idx-1;
|
||||
if( lwr>upr ){ c = +1; break; }
|
||||
}else{
|
||||
assert( nCellKey==intKey );
|
||||
pCur->validNKey = 1;
|
||||
pCur->info.nKey = nCellKey;
|
||||
pCur->aiIdx[pCur->iPage] = (u16)idx;
|
||||
if( !pPage->leaf ){
|
||||
lwr = idx;
|
||||
c = 0;
|
||||
break;
|
||||
}else{
|
||||
*pRes = 0;
|
||||
rc = SQLITE_OK;
|
||||
goto moveto_finish;
|
||||
}
|
||||
}else if( nCellKey<intKey ){
|
||||
lwr = idx+1;
|
||||
}else{
|
||||
assert( nCellKey>intKey );
|
||||
upr = idx-1;
|
||||
}
|
||||
if( lwr>upr ){
|
||||
c = nCellKey<intKey ? -1 : +1;
|
||||
pCur->aiIdx[pCur->iPage] = (u16)idx;
|
||||
break;
|
||||
}
|
||||
idx = (lwr+upr)/2;
|
||||
}
|
||||
@@ -4752,19 +4750,18 @@ int sqlite3BtreeMovetoUnpacked(
|
||||
c = sqlite3VdbeRecordCompare(nCell, pCellKey, pIdxKey);
|
||||
sqlite3_free(pCellKey);
|
||||
}
|
||||
if( c==0 ){
|
||||
if( c<0 ){
|
||||
lwr = idx+1;
|
||||
}else if( c>0 ){
|
||||
upr = idx-1;
|
||||
}else{
|
||||
assert( c==0 );
|
||||
*pRes = 0;
|
||||
rc = SQLITE_OK;
|
||||
pCur->aiIdx[pCur->iPage] = (u16)idx;
|
||||
goto moveto_finish;
|
||||
}
|
||||
if( c<0 ){
|
||||
lwr = idx+1;
|
||||
}else{
|
||||
upr = idx-1;
|
||||
}
|
||||
if( lwr>upr ){
|
||||
pCur->aiIdx[pCur->iPage] = (u16)idx;
|
||||
break;
|
||||
}
|
||||
idx = (lwr+upr)/2;
|
||||
@@ -4774,6 +4771,7 @@ int sqlite3BtreeMovetoUnpacked(
|
||||
assert( pPage->isInit );
|
||||
if( pPage->leaf ){
|
||||
assert( pCur->aiIdx[pCur->iPage]<pCur->apPage[pCur->iPage]->nCell );
|
||||
pCur->aiIdx[pCur->iPage] = (u16)idx;
|
||||
*pRes = c;
|
||||
rc = SQLITE_OK;
|
||||
goto moveto_finish;
|
||||
|
Reference in New Issue
Block a user