Add the ability to disable the push-down optimization using the 0x1000 bit of
SQLITE_TESTCTRL_OPTIMIZATIONS. FossilOrigin-Name: eddc35f3057e59fdc25a6911abfaa53a10cc43d8030925b65737b2f51f907421
This commit is contained in:
@@ -3853,6 +3853,7 @@ static int pushDownWhereTerms(
|
||||
Expr *pNew;
|
||||
int nChng = 0;
|
||||
if( pWhere==0 ) return 0;
|
||||
return 0;
|
||||
if( pSubq->selFlags & SF_Recursive ) return 0; /* restriction (2) */
|
||||
|
||||
#ifdef SQLITE_DEBUG
|
||||
@@ -5334,6 +5335,7 @@ int sqlite3Select(
|
||||
** inside the subquery. This can help the subquery to run more efficiently.
|
||||
*/
|
||||
if( (pItem->fg.jointype & JT_OUTER)==0
|
||||
&& OptimizationEnabled(db, SQLITE_PushDown)
|
||||
&& pushDownWhereTerms(pParse, pSub, p->pWhere, pItem->iCursor)
|
||||
){
|
||||
#if SELECTTRACE_ENABLED
|
||||
@@ -5342,6 +5344,8 @@ int sqlite3Select(
|
||||
sqlite3TreeViewSelect(0, p, 0);
|
||||
}
|
||||
#endif
|
||||
}else{
|
||||
SELECTTRACE(0x100,pParse,p,("Push-down not possible\n"));
|
||||
}
|
||||
|
||||
zSavedAuthContext = pParse->zAuthContext;
|
||||
|
||||
@@ -1532,6 +1532,7 @@ struct sqlite3 {
|
||||
#define SQLITE_CursorHints 0x0400 /* Add OP_CursorHint opcodes */
|
||||
#define SQLITE_Stat34 0x0800 /* Use STAT3 or STAT4 data */
|
||||
/* TH3 expects the Stat34 ^^^^^^ value to be 0x0800. Don't change it */
|
||||
#define SQLITE_PushDown 0x1000 /* The push-down optimization */
|
||||
#define SQLITE_AllOpts 0xffff /* All optimizations */
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user