]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Remove the obsolete lastRowid cache from the sqlite3VdbeExec() for a size
authordrh <drh@noemail.net>
Thu, 26 Jan 2017 17:26:44 +0000 (17:26 +0000)
committerdrh <drh@noemail.net>
Thu, 26 Jan 2017 17:26:44 +0000 (17:26 +0000)
reduction and performance improvement.

FossilOrigin-Name: b4803184652e5f4f823c1521412bc480baeb3dbf

manifest
manifest.uuid
src/vdbe.c

index 11ce60cdc3f8425b6a5569bd80d5c2bd0d5dc630..2bd3d3e394eb9a3b8b92075409d451622ef8804f 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Performance\soptimization\sin\ssqlite3VdbeCloseStatement().
-D 2017-01-26T17:11:18.355
+C Remove\sthe\sobsolete\slastRowid\scache\sfrom\sthe\ssqlite3VdbeExec()\sfor\sa\ssize\nreduction\sand\sperformance\simprovement.
+D 2017-01-26T17:26:44.998
 F Makefile.in 5f415e7867296d678fed2e6779aea10c1318b4bc
 F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434
 F Makefile.msc b8ca53350ae545e3562403d5da2a69cec79308da
@@ -457,7 +457,7 @@ F src/update.c b356b29d04c71f33c779f2cb557cf953819bdd7a
 F src/utf.c 699001c79f28e48e9bcdf8a463da029ea660540c
 F src/util.c a88b0466fddf445ce752226d4698ca3faada620a
 F src/vacuum.c 33c174b28886b2faf26e503b5a49a1c01a9b1c16
-F src/vdbe.c 1fa3e8f3ee1cdfc56d9559bca9ca2c84e4a398be
+F src/vdbe.c 96f1639399feb97500d927219b87183aad3ef94c
 F src/vdbe.h 59998ffd71d7caa8886bc78dafaf8caeccd4c13c
 F src/vdbeInt.h 281cb70332dc8b593b8c7afe776f3a2ba7d4255e
 F src/vdbeapi.c 7a65f10684982daecfce50f557f2632b7f20b198
@@ -1547,7 +1547,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
 F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
 F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
-P 7459f4b7ed4007d9ec44c3bf0fcba04f5f8540a9
-R b420e83a1f23766d77baebce9b33f9ae
+P 1e96e5ec1ee617cb5b5cbdc5a2ee79c8cc35821d
+R f17134692e3127e9f97d9e12f2b91a46
 U drh
-Z 2c16f151f6d1962e9b2a5835576e2c7c
+Z 7f3d9d2e9e1038bd56eb8c4623402887
index 9f15fbe8cbaa4b7f3c5741a817d665425296ac5a..313588dfbb759411875c7beeb71cf2fb2c2abc02 100644 (file)
@@ -1 +1 @@
-1e96e5ec1ee617cb5b5cbdc5a2ee79c8cc35821d
\ No newline at end of file
+b4803184652e5f4f823c1521412bc480baeb3dbf
\ No newline at end of file
index 6838acccd5c9bf47bf47d6119059af9e35c0ce60..afb23007c6ee255b9473a770e3a44b054d443e22 100644 (file)
@@ -584,7 +584,6 @@ int sqlite3VdbeExec(
   Mem *pIn3 = 0;             /* 3rd input operand */
   Mem *pOut = 0;             /* Output operand */
   int *aPermute = 0;         /* Permutation of columns for OP_Compare */
-  i64 lastRowid = db->lastRowid;  /* Saved value of the last insert ROWID */
 #ifdef VDBE_PROFILE
   u64 start;                 /* CPU clock count at start of opcode */
 #endif
@@ -960,7 +959,6 @@ case OP_Halt: {
     p->nFrame--;
     sqlite3VdbeSetChanges(db, p->nChange);
     pcx = sqlite3VdbeFrameRestore(pFrame);
-    lastRowid = db->lastRowid;
     if( pOp->p2==OE_Ignore ){
       /* Instruction pcx is the OP_Program that invoked the sub-program 
       ** currently being halted. If the p2 instruction of this OP_Halt
@@ -1682,9 +1680,7 @@ case OP_Function: {
 #endif
   MemSetTypeFlag(pCtx->pOut, MEM_Null);
   pCtx->fErrorOrAux = 0;
-  db->lastRowid = lastRowid;
   (*pCtx->pFunc->xSFunc)(pCtx, pCtx->argc, pCtx->argv);/* IMP: R-24505-23230 */
-  lastRowid = db->lastRowid;  /* Remember rowid changes made by xSFunc */
 
   /* If the function returned an error, throw an exception */
   if( pCtx->fErrorOrAux ){
@@ -4418,7 +4414,7 @@ case OP_InsertInt: {
 #endif
 
   if( pOp->p5 & OPFLAG_NCHANGE ) p->nChange++;
-  if( pOp->p5 & OPFLAG_LASTROWID ) db->lastRowid = lastRowid = x.nKey;
+  if( pOp->p5 & OPFLAG_LASTROWID ) db->lastRowid = x.nKey;
   if( pData->flags & MEM_Null ){
     x.pData = 0;
     x.nData = 0;
@@ -5863,7 +5859,7 @@ case OP_Program: {        /* jump */
 
   p->nFrame++;
   pFrame->pParent = p->pFrame;
-  pFrame->lastRowid = lastRowid;
+  pFrame->lastRowid = db->lastRowid;
   pFrame->nChange = p->nChange;
   pFrame->nDbChange = p->db->nChange;
   assert( pFrame->pAuxData==0 );
@@ -6804,7 +6800,7 @@ case OP_VUpdate: {
     sqlite3VtabImportErrmsg(p, pVtab);
     if( rc==SQLITE_OK && pOp->p1 ){
       assert( nArg>1 && apArg[0] && (apArg[0]->flags&MEM_Null) );
-      db->lastRowid = lastRowid = rowid;
+      db->lastRowid = rowid;
     }
     if( (rc&0xff)==SQLITE_CONSTRAINT && pOp->p4.pVtab->bConstraint ){
       if( pOp->p5==OE_Ignore ){
@@ -7040,7 +7036,6 @@ abort_due_to_error:
   ** release the mutexes on btrees that were acquired at the
   ** top. */
 vdbe_return:
-  db->lastRowid = lastRowid;
   testcase( nVmStep>0 );
   p->aCounter[SQLITE_STMTSTATUS_VM_STEP] += (int)nVmStep;
   sqlite3VdbeLeave(p);