diff options
author | drh <> | 2024-05-28 00:01:07 +0000 |
---|---|---|
committer | drh <> | 2024-05-28 00:01:07 +0000 |
commit | 38af12523865b98cdc64fa518fc85ea754697e09 (patch) | |
tree | 9f49d46688eaf2b7af6ce834a1a546cb4ed3bc0d /src | |
parent | eeb8506c18173fb26c0b2d93f89a2a66b90711cc (diff) | |
download | sqlite-38af12523865b98cdc64fa518fc85ea754697e09.tar.gz sqlite-38af12523865b98cdc64fa518fc85ea754697e09.zip |
Query planner tuning: Increase the maximum number of simultaneous solutions
to track int eh solver from 10 to 12.
FossilOrigin-Name: fe2e1dadbacbe6392ceed44fd287a2ed82189cb8055f35631d37967d9a7a5d1d
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 a266b51d0..9ef48fb33 100644 --- a/src/where.c +++ b/src/where.c @@ -5242,10 +5242,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)); |