mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-14 00:22:38 +03:00
Add a test-control to disable the skip-scan optimization.
FossilOrigin-Name: 650a3fe03d61068e06f3097878a777ca8ed713a769444cdb3f8be7d1e19a0b83
This commit is contained in:
@@ -1583,6 +1583,7 @@ struct sqlite3 {
|
||||
/* TH3 expects the Stat34 ^^^^^^ value to be 0x0800. Don't change it */
|
||||
#define SQLITE_PushDown 0x1000 /* The push-down optimization */
|
||||
#define SQLITE_SimplifyJoin 0x2000 /* Convert LEFT JOIN to JOIN */
|
||||
#define SQLITE_SkipScan 0x4000 /* Skip-scans */
|
||||
#define SQLITE_AllOpts 0xffff /* All optimizations */
|
||||
|
||||
/*
|
||||
|
||||
@@ -6954,6 +6954,7 @@ static int SQLITE_TCLAPI optimization_control(
|
||||
{ "omit-noop-join", SQLITE_OmitNoopJoin },
|
||||
{ "stat3", SQLITE_Stat34 },
|
||||
{ "stat4", SQLITE_Stat34 },
|
||||
{ "skip-scan", SQLITE_SkipScan },
|
||||
};
|
||||
|
||||
if( objc!=4 ){
|
||||
|
||||
@@ -2672,6 +2672,7 @@ static int whereLoopAddBtreeIndex(
|
||||
if( saved_nEq==saved_nSkip
|
||||
&& saved_nEq+1<pProbe->nKeyCol
|
||||
&& pProbe->noSkipScan==0
|
||||
&& OptimizationEnabled(db, SQLITE_SkipScan)
|
||||
&& pProbe->aiRowLogEst[saved_nEq+1]>=42 /* TUNING: Minimum for skip-scan */
|
||||
&& (rc = whereLoopResize(db, pNew, pNew->nLTerm+1))==SQLITE_OK
|
||||
){
|
||||
|
||||
Reference in New Issue
Block a user