diff options
author | dan <dan@noemail.net> | 2017-06-22 16:51:16 +0000 |
---|---|---|
committer | dan <dan@noemail.net> | 2017-06-22 16:51:16 +0000 |
commit | c456a76fb326d99e6d09a2d13f732fc9d15b3d33 (patch) | |
tree | 2fbc7891679d33d04d43260823d6e6b2b99389ba /src/tclsqlite.c | |
parent | c45fdb2a7f7935cbaa4d13d2e0410a1dce2dbcbf (diff) | |
download | sqlite-c456a76fb326d99e6d09a2d13f732fc9d15b3d33.tar.gz sqlite-c456a76fb326d99e6d09a2d13f732fc9d15b3d33.zip |
When generating individual loops for each ORed term of an OR scan, move any
constant WHERE expressions outside of the loop, as is done for top-level
loops.
FossilOrigin-Name: e4a022be4b069b08cfdfda5295461676b99d28e17bbbedfbcb362dec69de59bd
Diffstat (limited to 'src/tclsqlite.c')
-rw-r--r-- | src/tclsqlite.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/tclsqlite.c b/src/tclsqlite.c index 754775e8e..bb7c9e5b8 100644 --- a/src/tclsqlite.c +++ b/src/tclsqlite.c @@ -161,6 +161,7 @@ struct SqliteDb { int nStmt; /* Number of statements in stmtList */ IncrblobChannel *pIncrblob;/* Linked list of open incrblob channels */ int nStep, nSort, nIndex; /* Statistics for most recent operation */ + int nVMStep; /* Another statistic for most recent operation */ int nTransaction; /* Number of nested [transaction] methods */ int openFlags; /* Flags used to open. (SQLITE_OPEN_URI) */ #ifdef SQLITE_TEST @@ -1588,6 +1589,7 @@ static int dbEvalStep(DbEvalContext *p){ pDb->nStep = sqlite3_stmt_status(pStmt,SQLITE_STMTSTATUS_FULLSCAN_STEP,1); pDb->nSort = sqlite3_stmt_status(pStmt,SQLITE_STMTSTATUS_SORT,1); pDb->nIndex = sqlite3_stmt_status(pStmt,SQLITE_STMTSTATUS_AUTOINDEX,1); + pDb->nVMStep = sqlite3_stmt_status(pStmt,SQLITE_STMTSTATUS_VM_STEP,1); dbReleaseColumnNames(p); p->pPreStmt = 0; @@ -2855,7 +2857,7 @@ static int SQLITE_TCLAPI DbObjCmd( } /* - ** $db status (step|sort|autoindex) + ** $db status (step|sort|autoindex|vmstep) ** ** Display SQLITE_STMTSTATUS_FULLSCAN_STEP or ** SQLITE_STMTSTATUS_SORT for the most recent eval. @@ -2874,9 +2876,11 @@ static int SQLITE_TCLAPI DbObjCmd( v = pDb->nSort; }else if( strcmp(zOp, "autoindex")==0 ){ v = pDb->nIndex; + }else if( strcmp(zOp, "vmstep")==0 ){ + v = pDb->nVMStep; }else{ Tcl_AppendResult(interp, - "bad argument: should be autoindex, step, or sort", + "bad argument: should be autoindex, step, sort or vmstep", (char*)0); return TCL_ERROR; } |