1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-29 08:01:23 +03:00

Adjust the cost estimates for RTREE such that the expected number of rows and

expected cost is halved for each additional constraint.

FossilOrigin-Name: fd7cd0609381a85673d1f737ebeb19dde3de180f
This commit is contained in:
drh
2016-03-05 20:28:24 +00:00
parent 115305ff00
commit 2ea74dc805
3 changed files with 9 additions and 12 deletions

View File

@ -1741,7 +1741,7 @@ static int rtreeBestIndex(sqlite3_vtab *tab, sqlite3_index_info *pIdxInfo){
return SQLITE_NOMEM;
}
nRow = pRtree->nRowEst / (iIdx + 1);
nRow = pRtree->nRowEst >> (iIdx/2);
pIdxInfo->estimatedCost = (double)6.0 * (double)nRow;
setEstimatedRows(pIdxInfo, nRow);