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