From: drh Date: Mon, 29 Jun 2015 23:01:32 +0000 (+0000) Subject: From sqlite3BtreeInsert(), bypass the btreeMoveto() routine for table inserts X-Git-Tag: version-3.8.11~93 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=207c8173652fb66b72aed5cb2bea8f10406104ba;p=thirdparty%2Fsqlite.git From sqlite3BtreeInsert(), bypass the btreeMoveto() routine for table inserts and go directly to sqlite3BtreeMovetoUnpacked(). FossilOrigin-Name: 53fe685d56368af78238c8981cc41704929f7660 --- diff --git a/manifest b/manifest index 0e5abb1e89..9d8e547563 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Add\sa\sbypass\spath\sin\ssqlite3PagerWrite()\sfor\spages\swith\sthe\sPGHDR_WRITEABLE\nbit\sset,\sfor\sabout\sa\s1%\sperformance\sincrease. -D 2015-06-29T20:53:18.096 +C From\ssqlite3BtreeInsert(),\sbypass\sthe\sbtreeMoveto()\sroutine\sfor\stable\sinserts\nand\sgo\sdirectly\sto\ssqlite3BtreeMovetoUnpacked(). +D 2015-06-29T23:01:32.059 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 285a0a234ed7610d431d91671c136098c2bd86a9 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -269,7 +269,7 @@ F src/auth.c b56c78ebe40a2110fd361379f7e8162d23f92240 F src/backup.c ff743689c4d6c5cb55ad42ed9d174b2b3e71f1e3 F src/bitvec.c d1f21d7d91690747881f03940584f4cc548c9d3d F src/btmutex.c 45a968cc85afed9b5e6cf55bf1f42f8d18107f79 -F src/btree.c ce342e156716fb64b9cf5c040260d0b47989f37b +F src/btree.c 9d8ae0dbbd0fc11c31f8ebdf52268b294d07aa9b F src/btree.h 969adc948e89e449220ff0ff724c94bb2a52e9f1 F src/btreeInt.h 8ca7124af9ee2ce27747a4e5500c27a254dea8eb F src/build.c b3f15255d5b16e42dafeaa638fd4f8a47c94ed70 @@ -1364,7 +1364,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 48bd54594752d5be3337f12c72f28d2080cb630b F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 3b65eb56c422855ca47f709247205f0c77d98a5c -R 7a2e6c81396cabeccb9e57205ef7b5ff +P ba425a6abb9886e6af87b5f6205202db450beba8 +R e5f91453b5eeda72698cccaefb998050 U drh -Z 8e32abe3d4ffc02aca1a13a0a405eb07 +Z 1793079077cd0546fcb9227de9d5c3a3 diff --git a/manifest.uuid b/manifest.uuid index ec2a9d057c..8990887238 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -ba425a6abb9886e6af87b5f6205202db450beba8 \ No newline at end of file +53fe685d56368af78238c8981cc41704929f7660 \ No newline at end of file diff --git a/src/btree.c b/src/btree.c index 027012e33a..95c18ff547 100644 --- a/src/btree.c +++ b/src/btree.c @@ -7903,20 +7903,22 @@ int sqlite3BtreeInsert( if( rc ) return rc; if( pCur->pKeyInfo==0 ){ + assert( pKey==0 ); /* If this is an insert into a table b-tree, invalidate any incrblob ** cursors open on the row being replaced */ invalidateIncrblobCursors(p, nKey, 0); /* If the cursor is currently on the last row and we are appending a - ** new row onto the end, set the "loc" to avoid an unnecessary btreeMoveto() - ** call */ + ** new row onto the end, set the "loc" to avoid an unnecessary + ** btreeMoveto() call */ if( (pCur->curFlags&BTCF_ValidNKey)!=0 && nKey>0 && pCur->info.nKey==nKey-1 ){ - loc = -1; + loc = -1; + }else if( loc==0 ){ + rc = sqlite3BtreeMovetoUnpacked(pCur, 0, nKey, appendBias, &loc); + if( rc ) return rc; } - } - - if( !loc ){ + }else if( loc==0 ){ rc = btreeMoveto(pCur, pKey, nKey, appendBias, &loc); if( rc ) return rc; }