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

Avoid using left-most column STAT3 samples if the left-most column has an

equality constrain and there are inequality constraints on the second column.

FossilOrigin-Name: 31b4e63b3c30fcad22340d84d6076a306f26b49e
This commit is contained in:
drh
2013-08-01 16:52:50 +00:00
parent c6fc65ce08
commit 788482c745
3 changed files with 9 additions and 9 deletions

View File

@@ -4420,7 +4420,7 @@ static int whereLoopAddBtreeIndex(
pNew->nOut = saved_nOut>rDiv+10 ? saved_nOut - rDiv : 10;
}
#ifdef SQLITE_ENABLE_STAT3
if( pNew->u.btree.nEq==1 && pProbe->nSample
if( pNew->u.btree.nEq==1 && pProbe->nSample && saved_nEq==0
&& OptimizationEnabled(db, SQLITE_Stat3) ){
tRowcnt nOut = 0;
if( (pTerm->eOperator & (WO_EQ|WO_ISNULL))!=0 ){