Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitdd8e191

Browse files
committed
Consider disk-based hash aggregation to implement DISTINCT.
Correct oversight in1f39bce. If enable_hashagg_disk=true, we shouldconsider hash aggregation for DISTINCT when applicable.
1 parent3649133 commitdd8e191

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
Sizehashentrysize=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)

[8]ページ先頭

©2009-2025 Movatter.jp