We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3649133 commit dd8e191Copy full SHA for dd8e191
src/backend/optimizer/plan/planner.c
@@ -4868,8 +4868,8 @@ create_distinct_paths(PlannerInfo *root,
4868
Size hashentrysize = hash_agg_entry_size(
4869
0, cheapest_input_path->pathtarget->width, 0);
4870
4871
- /* Allow hashing only if hashtable is predicted to fit in work_mem */
4872
- allow_hash = (hashentrysize * numDistinctRows <= work_mem * 1024L);
+ allow_hash = enable_hashagg_disk ||
+ (hashentrysize * numDistinctRows <= work_mem * 1024L);
4873
}
4874
4875
if (allow_hash && grouping_is_hashable(parse->distinctClause))
0 commit comments