From 3ba11d3df2115b04171a8eda8e0389e02578d8d0 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Thu, 7 Oct 2010 20:00:28 -0400 Subject: Teach CLUSTER to use seqscan-and-sort when it's faster than indexscan. ... or at least, when the planner's cost estimates say it will be faster. Leonardo Francalanci, reviewed by Itagaki Takahiro and Tom Lane --- src/backend/optimizer/prep/prepunion.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/backend/optimizer/prep/prepunion.c') diff --git a/src/backend/optimizer/prep/prepunion.c b/src/backend/optimizer/prep/prepunion.c index f904258280..0d3a739175 100644 --- a/src/backend/optimizer/prep/prepunion.c +++ b/src/backend/optimizer/prep/prepunion.c @@ -805,7 +805,8 @@ choose_hashed_setop(PlannerInfo *root, List *groupClauses, sorted_p.total_cost = input_plan->total_cost; /* XXX cost_sort doesn't actually look at pathkeys, so just pass NIL */ cost_sort(&sorted_p, root, NIL, sorted_p.total_cost, - input_plan->plan_rows, input_plan->plan_width, -1.0); + input_plan->plan_rows, input_plan->plan_width, + 0.0, work_mem, -1.0); cost_group(&sorted_p, root, numGroupCols, dNumGroups, sorted_p.startup_cost, sorted_p.total_cost, input_plan->plan_rows); -- cgit v1.2.1