8000 Revert ill-considered change of index-size fudge factor. · danielcode/postgres@3e9960e · GitHub
[go: up one dir, main page]

Skip to content

Commit 3e9960e

Browse files
committed
Revert ill-considered change of index-size fudge factor.
This partially reverts commit 21a39de, restoring the pre-9.2 cost estimates for index usage. That change introduced much too large a bias against larger indexes, as per reports from Jeff Janes and others. The whole thing needs a rewrite, which I've done in HEAD, but the safest thing to do in 9.2 is just to undo this multiplier change.
1 parent 0b3c54a commit 3e9960e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/backend/utils/adt/selfuncs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6130,11 +6130,11 @@ genericcostestimate(PlannerInfo *root,
61306130
*
61316131
* We can deal with this by adding a very small "fudge factor" that
61326132
* depends on the index size. The fudge factor used here is one
6133-
* spc_random_page_cost per 10000 index pages, which should be small
6133+
* spc_random_page_cost per 100000 index pages, which should be small
61346134
* enough to not alter index-vs-seqscan decisions, but will prevent
61356135
* indexes of different sizes from looking exactly equally attractive.
61366136
*/
6137-
*indexTotalCost += index->pages * spc_random_page_cost / 10000.0;
6137+
*indexTotalCost += index->pages * spc_random_page_cost / 100000.0;
61386138

61396139
/*
61406140
* CPU cost: any complex expressions in the indexquals will need to be

0 commit comments

Comments
 (0)
0