- Notifications
You must be signed in to change notification settings - Fork5
Commit3454876
committed
Fix hash table size estimation error in choose_hashed_distinct().
We should account for the per-group hashtable entry overhead whenconsidering whether to use a hash aggregate to implement DISTINCT. Thecomparable logic in choose_hashed_grouping() gets this right, but I thinkI omitted it here in the mistaken belief that there would be no overheadif there were no aggregate functions to be evaluated. This can result inmore than 2X underestimate of the hash table size, if the tuples beingaggregated aren't very wide. Per report from Tomas Vondra.This bug is of long standing, but per discussion we'll only back-patch into9.3. Changing the estimation behavior in stable branches seems to carry toomuch risk of destabilizing plan choices for already-tuned applications.1 parent5dcc48c commit3454876
1 file changed
+4
-0
lines changedLines changed: 4 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2848 | 2848 |
| |
2849 | 2849 |
| |
2850 | 2850 |
| |
| 2851 | + | |
| 2852 | + | |
2851 | 2853 |
| |
| 2854 | + | |
| 2855 | + | |
2852 | 2856 |
| |
2853 | 2857 |
| |
2854 | 2858 |
| |
|
0 commit comments
Comments
(0)