forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitbf01e34
committed
Tweak genericcostestimate's fudge factor for index size.
To provide some bias against using a large index when a small one would doas well, genericcostestimate adds a "fudge factor", which for a long timewas random_page_cost * index_pages/10000. However, this can grow to be thedominant term in indexscan cost estimates when the index involved is largeenough, a behavior that was never intended. Change to a ln(1 + n/10000)formulation, which has nearly the same behavior up to a few hundred pagesbut tails off significantly thereafter. (A log curve seems correct onfirst principles, since what we're trying to account for here is indexdescent costs, which are typically logarithmic.) Per bug #7619 from NikoKiirala.Possibly this change should get back-patched, but I'm hesitant to mess withcost estimates in stable branches.1 parenta4e8680 commitbf01e34
1 file changed
+7
-5
lines changedLines changed: 7 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
6130 | 6130 |
| |
6131 | 6131 |
| |
6132 | 6132 |
| |
6133 |
| - | |
6134 |
| - | |
6135 |
| - | |
6136 |
| - | |
| 6133 | + | |
| 6134 | + | |
| 6135 | + | |
| 6136 | + | |
| 6137 | + | |
| 6138 | + | |
6137 | 6139 |
| |
6138 |
| - | |
| 6140 | + | |
6139 | 6141 |
| |
6140 | 6142 |
| |
6141 | 6143 |
| |
|
0 commit comments
Comments
(0)