1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-18 10:21:03 +03:00

Disallow the skip-scan optimization in the absence of sqlite_stat1 data.

FossilOrigin-Name: e0c6b8bdb76fcd4f08c89ff20dce6a33ef3c11752e1e919fec5c4e7d423c4b93
This commit is contained in:
drh
2020-02-13 14:51:54 +00:00
parent 0ba3621592
commit ab7fdca2ee
3 changed files with 8 additions and 7 deletions

View File

@@ -2732,6 +2732,7 @@ static int whereLoopAddBtreeIndex(
&& saved_nEq+1<pProbe->nKeyCol
&& saved_nEq==pNew->nLTerm
&& pProbe->noSkipScan==0
&& pProbe->hasStat1!=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