diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/where.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/where.c b/src/where.c index accad8625..980047947 100644 --- a/src/where.c +++ b/src/where.c @@ -5279,10 +5279,16 @@ static int wherePathSolver(WhereInfo *pWInfo, LogEst nRowEst){ pParse = pWInfo->pParse; nLoop = pWInfo->nLevel; - /* TUNING: For simple queries, only the best path is tracked. - ** For 2-way joins, the 5 best paths are followed. - ** For joins of 3 or more tables, track the 10 best paths */ - mxChoice = (nLoop<=1) ? 1 : (nLoop==2 ? 5 : 10); + /* TUNING: mxChoice is the maximum number of possible paths to preserve + ** at each step. Based on the number of loops in the FROM clause: + ** + ** nLoop mxChoice + ** ----- -------- + ** 1 1 // the most common case + ** 2 5 + ** 3+ 12 + */ + mxChoice = (nLoop<=1) ? 1 : (nLoop==2 ? 5 : 12); assert( nLoop<=pWInfo->pTabList->nSrc ); WHERETRACE(0x002, ("---- begin solver. (nRowEst=%d, nQueryLoop=%d)\n", nRowEst, pParse->nQueryLoop)); |