]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
From sqlite3BtreeInsert(), bypass the btreeMoveto() routine for table inserts
authordrh <drh@noemail.net>
Mon, 29 Jun 2015 23:01:32 +0000 (23:01 +0000)
committerdrh <drh@noemail.net>
Mon, 29 Jun 2015 23:01:32 +0000 (23:01 +0000)
and go directly to sqlite3BtreeMovetoUnpacked().

FossilOrigin-Name: 53fe685d56368af78238c8981cc41704929f7660

manifest
manifest.uuid
src/btree.c

index 0e5abb1e89c27dbcfaea6873fa99991ebf6be2a4..9d8e547563e5354dd14cbc527dc4e4e4175a32e8 100644 (file)
--- 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
index ec2a9d057cc2ff992076ace156964a7dd7c47bb2..89908872389d524ba5faa8d73939feb5125ec025 100644 (file)
@@ -1 +1 @@
-ba425a6abb9886e6af87b5f6205202db450beba8
\ No newline at end of file
+53fe685d56368af78238c8981cc41704929f7660
\ No newline at end of file
index 027012e33aab949f8549325b0e3de821b254d76d..95c18ff5476e04d67785ccab101a743c27f65fbd 100644 (file)
@@ -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;
   }