1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-07 02:42:48 +03:00

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
This commit is contained in:
dan
2017-06-22 16:51:16 +00:00
parent c45fdb2a7f
commit c456a76fb3
7 changed files with 131 additions and 32 deletions

View File

@@ -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;
}