mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-18 10:21:03 +03:00
Remove the unexplained extra 3.0 cost factor for the B-tree sorting that is
done to implement DISTINCT in the absence of an index to help. FossilOrigin-Name: 52571991fcfa2629e8a8354e0c9a62e749a092bf
This commit is contained in:
@@ -3460,14 +3460,6 @@ static LogEst whereSortingCost(
|
||||
assert( nOrderBy>0 && 66==sqlite3LogEst(100) );
|
||||
rScale = sqlite3LogEst((nOrderBy-nSorted)*100/nOrderBy) - 66;
|
||||
rSortCost = nRow + estLog(nRow) + rScale + 16;
|
||||
|
||||
/* TUNING: The cost of implementing DISTINCT using a B-TREE is
|
||||
** similar but with a larger constant of proportionality.
|
||||
** Multiply by an additional factor of 3.0. */
|
||||
if( pWInfo->wctrlFlags & WHERE_WANT_DISTINCT ){
|
||||
rSortCost += 16;
|
||||
}
|
||||
|
||||
return rSortCost;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user