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

Fix to the decision logic for when to use the skip-ahead-distinct optimization.

FossilOrigin-Name: e50fd48969f99bc988389c53ff46714603b1d11de12c71b55c00cbee037f073c
This commit is contained in:
drh
2017-04-14 22:41:27 +00:00
parent 571311502d
commit a2e2d92b21
3 changed files with 9 additions and 8 deletions

View File

@@ -4858,7 +4858,8 @@ void sqlite3WhereEnd(WhereInfo *pWInfo){
if( pWInfo->eDistinct==WHERE_DISTINCT_ORDERED
&& (pLoop->wsFlags & WHERE_INDEXED)!=0
&& (pIdx = pLoop->u.btree.pIndex)->hasStat1
&& pIdx->aiRowLogEst[(n = pLoop->u.btree.nIdxCol)-1]>=36
&& (n = pLoop->u.btree.nIdxCol)>0
&& pIdx->aiRowLogEst[n]>=36
){
int r1 = pParse->nMem+1;
int j, op;