1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-12 13:01:09 +03:00

Adjustments to the cost computation for the skip-scan query plan, to take

into account the fact that a seek has to occur on each skip.

FossilOrigin-Name: 0769eebd028ce31375cf93509a1d3687f7b117eb
This commit is contained in:
drh
2014-03-10 20:12:31 +00:00
parent b06a4ec1f0
commit 89212fb9f9
4 changed files with 49 additions and 8 deletions

View File

@@ -3974,7 +3974,10 @@ static int whereLoopAddBtreeIndex(
pNew->aLTerm[pNew->nLTerm++] = 0;
pNew->wsFlags |= WHERE_SKIPSCAN;
nIter = sqlite3LogEst(pProbe->aiRowEst[0]/pProbe->aiRowEst[saved_nEq+1]);
pNew->rRun = rLogSize + nIter;
pNew->nOut += nIter;
whereLoopAddBtreeIndex(pBuilder, pSrc, pProbe, nIter);
pNew->nOut = saved_nOut;
}
for(; rc==SQLITE_OK && pTerm!=0; pTerm = whereScanNext(&scan)){
int nIn = 0;