Content-Length: 264022 | pFad | http://github.com/postgrespro/postgres_cluster/commit/dd8e19132acfbb28d579288a412ed6c0a5ea338b

7F Consider disk-based hash aggregation to implement DISTINCT. · postgrespro/postgres_cluster@dd8e191 · GitHub
Skip to content

Commit dd8e191

Browse files
committed
Consider disk-based hash aggregation to implement DISTINCT.
Correct oversight in 1f39bce. If enable_hashagg_disk=true, we should consider hash aggregation for DISTINCT when applicable.
1 parent 3649133 commit dd8e191

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/backend/optimizer/plan/planner.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4868,8 +4868,8 @@ create_distinct_paths(PlannerInfo *root,
48684868
Size hashentrysize = hash_agg_entry_size(
48694869
0, cheapest_input_path->pathtarget->width, 0);
48704870

4871-
/* Allow hashing only if hashtable is predicted to fit in work_mem */
4872-
allow_hash = (hashentrysize * numDistinctRows <= work_mem * 1024L);
4871+
allow_hash = enable_hashagg_disk ||
4872+
(hashentrysize * numDistinctRows <= work_mem * 1024L);
48734873
}
48744874

48754875
if (allow_hash && grouping_is_hashable(parse->distinctClause))

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres_cluster/commit/dd8e19132acfbb28d579288a412ed6c0a5ea338b

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy