aboutsummaryrefslogtreecommitdiff
path: root/src/where.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2020-02-13 14:51:54 +0000
committerdrh <drh@noemail.net>2020-02-13 14:51:54 +0000
commitab7fdca2eec1b6d5143214155aa9dfda40de1b83 (patch)
tree5738cffc41a18e3568e250f5f68f84912fe527c7 /src/where.c
parent0ba3621592a060a4dbabcac02c48bf3d9d603c42 (diff)
downloadsqlite-ab7fdca2eec1b6d5143214155aa9dfda40de1b83.tar.gz
sqlite-ab7fdca2eec1b6d5143214155aa9dfda40de1b83.zip
Disallow the skip-scan optimization in the absence of sqlite_stat1 data.
FossilOrigin-Name: e0c6b8bdb76fcd4f08c89ff20dce6a33ef3c11752e1e919fec5c4e7d423c4b93
Diffstat (limited to 'src/where.c')
-rw-r--r--src/where.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/where.c b/src/where.c
index 54bbb7601..da9c5a723 100644
--- a/src/where.c
+++ b/src/where.c
@@ -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