mirror of
https://github.com/postgres/postgres.git
synced 2026-04-15 22:10:45 -04:00
Consider disk-based hash aggregation to implement DISTINCT.
Correct oversight in 1f39bce0. If enable_hashagg_disk=true, we should
consider hash aggregation for DISTINCT when applicable.
This commit is contained in:
parent
3649133b14
commit
dd8e19132a
1 changed files with 2 additions and 2 deletions
|
|
@ -4868,8 +4868,8 @@ create_distinct_paths(PlannerInfo *root,
|
|||
Size hashentrysize = hash_agg_entry_size(
|
||||
0, cheapest_input_path->pathtarget->width, 0);
|
||||
|
||||
/* Allow hashing only if hashtable is predicted to fit in work_mem */
|
||||
allow_hash = (hashentrysize * numDistinctRows <= work_mem * 1024L);
|
||||
allow_hash = enable_hashagg_disk ||
|
||||
(hashentrysize * numDistinctRows <= work_mem * 1024L);
|
||||
}
|
||||
|
||||
if (allow_hash && grouping_is_hashable(parse->distinctClause))
|
||||
|
|
|
|||
Loading…
Reference in a new issue