mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-08 14:02:16 +03:00
Add a new (experimental) sqlite3_stmt_status() verb that returns the number
of VM steps. FossilOrigin-Name: f1366bab737a3ac2ea20a0ec014cc306d7ded8a5
This commit is contained in:
23
manifest
23
manifest
@@ -1,5 +1,5 @@
|
|||||||
C Remove\san\sunused\sfunction\sdeclaration\sfrom\sthe\sFTS3\ssource\scode.
|
C Add\sa\snew\s(experimental)\ssqlite3_stmt_status()\sverb\sthat\sreturns\sthe\snumber\nof\sVM\ssteps.
|
||||||
D 2013-06-21T18:36:44.416
|
D 2013-06-25T22:01:22.917
|
||||||
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
|
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
|
||||||
F Makefile.in 5e41da95d92656a5004b03d3576e8b226858a28e
|
F Makefile.in 5e41da95d92656a5004b03d3576e8b226858a28e
|
||||||
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
|
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
|
||||||
@@ -216,8 +216,8 @@ F src/random.c cd4a67b3953b88019f8cd4ccd81394a8ddfaba50
|
|||||||
F src/resolve.c 89f9003e8316ee3a172795459efc2a0274e1d5a8
|
F src/resolve.c 89f9003e8316ee3a172795459efc2a0274e1d5a8
|
||||||
F src/rowset.c 64655f1a627c9c212d9ab497899e7424a34222e0
|
F src/rowset.c 64655f1a627c9c212d9ab497899e7424a34222e0
|
||||||
F src/select.c 22ee971346a736ddefdc4497d07c92f2e9978afc
|
F src/select.c 22ee971346a736ddefdc4497d07c92f2e9978afc
|
||||||
F src/shell.c ab6eea968c8745be3aa74e45fedb37d057b4cd0d
|
F src/shell.c a02544af6697c5782d29ec3204616f35ed9e8458
|
||||||
F src/sqlite.h.in 5b390ca5d94e09e56e7fee6a51ddde4721b89f8e
|
F src/sqlite.h.in 5f86553f4c1d8b4a9069285ed19e7981451ea77a
|
||||||
F src/sqlite3.rc fea433eb0a59f4c9393c8e6d76a6e2596b1fe0c0
|
F src/sqlite3.rc fea433eb0a59f4c9393c8e6d76a6e2596b1fe0c0
|
||||||
F src/sqlite3ext.h d936f797812c28b81b26ed18345baf8db28a21a5
|
F src/sqlite3ext.h d936f797812c28b81b26ed18345baf8db28a21a5
|
||||||
F src/sqliteInt.h 46fb17f604ce941551fe64c342dbeb4dbed3edaa
|
F src/sqliteInt.h 46fb17f604ce941551fe64c342dbeb4dbed3edaa
|
||||||
@@ -225,7 +225,7 @@ F src/sqliteLimit.h 164b0e6749d31e0daa1a4589a169d31c0dec7b3d
|
|||||||
F src/status.c bedc37ec1a6bb9399944024d63f4c769971955a9
|
F src/status.c bedc37ec1a6bb9399944024d63f4c769971955a9
|
||||||
F src/table.c 2cd62736f845d82200acfa1287e33feb3c15d62e
|
F src/table.c 2cd62736f845d82200acfa1287e33feb3c15d62e
|
||||||
F src/tclsqlite.c b8835978e853a89bf58de88acc943a5ca94d752e
|
F src/tclsqlite.c b8835978e853a89bf58de88acc943a5ca94d752e
|
||||||
F src/test1.c 6d2a340eea1d866bf7059894491652a69a7ee802
|
F src/test1.c d94d55d85e7250fa3493585635811c584b1d05be
|
||||||
F src/test2.c 7355101c085304b90024f2261e056cdff13c6c35
|
F src/test2.c 7355101c085304b90024f2261e056cdff13c6c35
|
||||||
F src/test3.c 1c0e5d6f080b8e33c1ce8b3078e7013fdbcd560c
|
F src/test3.c 1c0e5d6f080b8e33c1ce8b3078e7013fdbcd560c
|
||||||
F src/test4.c 9b32d22f5f150abe23c1830e2057c4037c45b3df
|
F src/test4.c 9b32d22f5f150abe23c1830e2057c4037c45b3df
|
||||||
@@ -276,9 +276,9 @@ F src/update.c 4c0c6864c4349ba292042e984a56d15985b57f4e
|
|||||||
F src/utf.c 8d819e2e5104a430fc2005f018db14347c95a38f
|
F src/utf.c 8d819e2e5104a430fc2005f018db14347c95a38f
|
||||||
F src/util.c f566b5138099a2df8533b190d0dcc74b7dfbe0c9
|
F src/util.c f566b5138099a2df8533b190d0dcc74b7dfbe0c9
|
||||||
F src/vacuum.c ddf21cc9577c4cb459d08bee9863a78ec000c5bb
|
F src/vacuum.c ddf21cc9577c4cb459d08bee9863a78ec000c5bb
|
||||||
F src/vdbe.c 34929e1b5bd95a85b5e1b7767b5cc8da582ad78d
|
F src/vdbe.c af2bc360189ce8eaed47133037e082a1652bc4a0
|
||||||
F src/vdbe.h b52887278cb173e66188da84dfab216bea61119d
|
F src/vdbe.h b52887278cb173e66188da84dfab216bea61119d
|
||||||
F src/vdbeInt.h c1e830268b75f04a2901dd895b51a637a26c7045
|
F src/vdbeInt.h b8a76f7b7304abfdb8e6bd286eba954ecfe73863
|
||||||
F src/vdbeapi.c 0b2c78797058c6c9bfa1687977de039566e22877
|
F src/vdbeapi.c 0b2c78797058c6c9bfa1687977de039566e22877
|
||||||
F src/vdbeaux.c af9cd9372c7ab82294b9645723e652c2d4213b95
|
F src/vdbeaux.c af9cd9372c7ab82294b9645723e652c2d4213b95
|
||||||
F src/vdbeblob.c 5dc79627775bd9a9b494dd956e26297946417d69
|
F src/vdbeblob.c 5dc79627775bd9a9b494dd956e26297946417d69
|
||||||
@@ -1094,7 +1094,10 @@ F tool/vdbe-compress.tcl f12c884766bd14277f4fcedcae07078011717381
|
|||||||
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
|
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
|
||||||
F tool/warnings.sh fbc018d67fd7395f440c28f33ef0f94420226381
|
F tool/warnings.sh fbc018d67fd7395f440c28f33ef0f94420226381
|
||||||
F tool/win/sqlite.vsix 97894c2790eda7b5bce3cc79cb2a8ec2fde9b3ac
|
F tool/win/sqlite.vsix 97894c2790eda7b5bce3cc79cb2a8ec2fde9b3ac
|
||||||
P 361084e1eb281e985568d19fe217263be92be31d
|
P 096ae1d8f9a08f92daedece6b0615f4d22b05023
|
||||||
R 0d6c636b8cfd628682ea33e027cb07be
|
R dca9e91df626c57b27d64840398d576b
|
||||||
|
T *branch * status-vm-step
|
||||||
|
T *sym-status-vm-step *
|
||||||
|
T -sym-trunk *
|
||||||
U drh
|
U drh
|
||||||
Z 55b5720fc386809651d148c0a8415781
|
Z 5f8be8eb1fd8b6cd7aa46981a30c4d1b
|
||||||
|
@@ -1 +1 @@
|
|||||||
096ae1d8f9a08f92daedece6b0615f4d22b05023
|
f1366bab737a3ac2ea20a0ec014cc306d7ded8a5
|
@@ -1109,6 +1109,8 @@ static int display_stats(
|
|||||||
fprintf(pArg->out, "Sort Operations: %d\n", iCur);
|
fprintf(pArg->out, "Sort Operations: %d\n", iCur);
|
||||||
iCur = sqlite3_stmt_status(pArg->pStmt, SQLITE_STMTSTATUS_AUTOINDEX, bReset);
|
iCur = sqlite3_stmt_status(pArg->pStmt, SQLITE_STMTSTATUS_AUTOINDEX, bReset);
|
||||||
fprintf(pArg->out, "Autoindex Inserts: %d\n", iCur);
|
fprintf(pArg->out, "Autoindex Inserts: %d\n", iCur);
|
||||||
|
iCur = sqlite3_stmt_status(pArg->pStmt, SQLITE_STMTSTATUS_VM_STEP, bReset);
|
||||||
|
fprintf(pArg->out, "Virtual Machine Steps: %d\n", iCur);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@@ -6303,11 +6303,21 @@ int sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg);
|
|||||||
** A non-zero value in this counter may indicate an opportunity to
|
** A non-zero value in this counter may indicate an opportunity to
|
||||||
** improvement performance by adding permanent indices that do not
|
** improvement performance by adding permanent indices that do not
|
||||||
** need to be reinitialized each time the statement is run.</dd>
|
** need to be reinitialized each time the statement is run.</dd>
|
||||||
|
**
|
||||||
|
** [[SQLITE_STMTSTATUS_VM_STEP]] <dt>SQLITE_STMTSTATUS_VM_STEP</dt>
|
||||||
|
** <dd>^This is the number of virtual machine operations executed
|
||||||
|
** by the prepared statement if that number is less than or equal
|
||||||
|
** to 2147483647. The number of virtual machine operations can be
|
||||||
|
** used as a proxy for the total work done by the prepared statement.
|
||||||
|
** If the number of virtual machine operations exceeds 2147483647
|
||||||
|
** then the value returned by this statement status code is undefined.
|
||||||
|
** </dd>
|
||||||
** </dl>
|
** </dl>
|
||||||
*/
|
*/
|
||||||
#define SQLITE_STMTSTATUS_FULLSCAN_STEP 1
|
#define SQLITE_STMTSTATUS_FULLSCAN_STEP 1
|
||||||
#define SQLITE_STMTSTATUS_SORT 2
|
#define SQLITE_STMTSTATUS_SORT 2
|
||||||
#define SQLITE_STMTSTATUS_AUTOINDEX 3
|
#define SQLITE_STMTSTATUS_AUTOINDEX 3
|
||||||
|
#define SQLITE_STMTSTATUS_VM_STEP 4
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** CAPI3REF: Custom Page Cache Object
|
** CAPI3REF: Custom Page Cache Object
|
||||||
|
@@ -2218,6 +2218,7 @@ static int test_stmt_status(
|
|||||||
{ "SQLITE_STMTSTATUS_FULLSCAN_STEP", SQLITE_STMTSTATUS_FULLSCAN_STEP },
|
{ "SQLITE_STMTSTATUS_FULLSCAN_STEP", SQLITE_STMTSTATUS_FULLSCAN_STEP },
|
||||||
{ "SQLITE_STMTSTATUS_SORT", SQLITE_STMTSTATUS_SORT },
|
{ "SQLITE_STMTSTATUS_SORT", SQLITE_STMTSTATUS_SORT },
|
||||||
{ "SQLITE_STMTSTATUS_AUTOINDEX", SQLITE_STMTSTATUS_AUTOINDEX },
|
{ "SQLITE_STMTSTATUS_AUTOINDEX", SQLITE_STMTSTATUS_AUTOINDEX },
|
||||||
|
{ "SQLITE_STMTSTATUS_VM_STEP", SQLITE_STMTSTATUS_VM_STEP },
|
||||||
};
|
};
|
||||||
if( objc!=4 ){
|
if( objc!=4 ){
|
||||||
Tcl_WrongNumArgs(interp, 1, objv, "STMT PARAMETER RESETFLAG");
|
Tcl_WrongNumArgs(interp, 1, objv, "STMT PARAMETER RESETFLAG");
|
||||||
|
@@ -556,12 +556,13 @@ int sqlite3VdbeExec(
|
|||||||
int checkProgress; /* True if progress callbacks are enabled */
|
int checkProgress; /* True if progress callbacks are enabled */
|
||||||
int nProgressOps = 0; /* Opcodes executed since progress callback. */
|
int nProgressOps = 0; /* Opcodes executed since progress callback. */
|
||||||
#endif
|
#endif
|
||||||
|
int iCompare = 0; /* Result of last OP_Compare operation */
|
||||||
|
unsigned nVmStep = 0; /* Number of virtual machine steps */
|
||||||
Mem *aMem = p->aMem; /* Copy of p->aMem */
|
Mem *aMem = p->aMem; /* Copy of p->aMem */
|
||||||
Mem *pIn1 = 0; /* 1st input operand */
|
Mem *pIn1 = 0; /* 1st input operand */
|
||||||
Mem *pIn2 = 0; /* 2nd input operand */
|
Mem *pIn2 = 0; /* 2nd input operand */
|
||||||
Mem *pIn3 = 0; /* 3rd input operand */
|
Mem *pIn3 = 0; /* 3rd input operand */
|
||||||
Mem *pOut = 0; /* Output operand */
|
Mem *pOut = 0; /* Output operand */
|
||||||
int iCompare = 0; /* Result of last OP_Compare operation */
|
|
||||||
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 */
|
i64 lastRowid = db->lastRowid; /* Saved value of the last insert ROWID */
|
||||||
#ifdef VDBE_PROFILE
|
#ifdef VDBE_PROFILE
|
||||||
@@ -606,6 +607,7 @@ int sqlite3VdbeExec(
|
|||||||
origPc = pc;
|
origPc = pc;
|
||||||
start = sqlite3Hwtime();
|
start = sqlite3Hwtime();
|
||||||
#endif
|
#endif
|
||||||
|
nVmStep++;
|
||||||
pOp = &aOp[pc];
|
pOp = &aOp[pc];
|
||||||
|
|
||||||
/* Only allow tracing if SQLITE_DEBUG is defined.
|
/* Only allow tracing if SQLITE_DEBUG is defined.
|
||||||
@@ -6200,6 +6202,7 @@ vdbe_error_halt:
|
|||||||
** top. */
|
** top. */
|
||||||
vdbe_return:
|
vdbe_return:
|
||||||
db->lastRowid = lastRowid;
|
db->lastRowid = lastRowid;
|
||||||
|
p->aCounter[SQLITE_STMTSTATUS_VM_STEP-1] += (int)nVmStep;
|
||||||
sqlite3VdbeLeave(p);
|
sqlite3VdbeLeave(p);
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
|
@@ -344,7 +344,7 @@ struct Vdbe {
|
|||||||
yDbMask btreeMask; /* Bitmask of db->aDb[] entries referenced */
|
yDbMask btreeMask; /* Bitmask of db->aDb[] entries referenced */
|
||||||
yDbMask lockMask; /* Subset of btreeMask that requires a lock */
|
yDbMask lockMask; /* Subset of btreeMask that requires a lock */
|
||||||
int iStatement; /* Statement number (or 0 if has not opened stmt) */
|
int iStatement; /* Statement number (or 0 if has not opened stmt) */
|
||||||
int aCounter[3]; /* Counters used by sqlite3_stmt_status() */
|
int aCounter[4]; /* Counters used by sqlite3_stmt_status() */
|
||||||
#ifndef SQLITE_OMIT_TRACE
|
#ifndef SQLITE_OMIT_TRACE
|
||||||
i64 startTime; /* Time when query started - used for profiling */
|
i64 startTime; /* Time when query started - used for profiling */
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user