Re: fix cost subqueryscan wrong parallel cost

From: Justin Pryzby <pryzby(at)telsasoft(dot)com>
To: Richard Guo <guofenglinux(at)gmail(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, bucoo(at)sohu(dot)com, pgsql-hackers(at)postgresql(dot)org, Tomas Vondra <tomas(dot)vondra(at)postgresql(dot)org>, Dmitry Dolgov <9erthalion6(at)gmail(dot)com>
Subject: Re: fix cost subqueryscan wrong parallel cost
Date: 2022-04-15 10:10:59
Message-ID: 20220415101059.GW26620@telsasoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Apr 15, 2022 at 05:16:44PM +0800, Richard Guo wrote:
> Not related to this topic but I noticed another problem from the plan.
> Note the first Sort node which is to unique-ify the result of the UNION.
> Why cannot we re-arrange the sort keys from (a, b, c) to (a, c, b) so
> that we can avoid the second Sort node?

I don't know, but it's possible there's a solution related to commit db0d67db2
"Optimize order of GROUP BY keys" - DISTINCT is the same as GROUP BY k1, ...,
kN. I guess UNION [DISTINCT] should learn to use GROUP BY rather than
DISTINCT?

--
Justin

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2022-04-15 12:47:14 Re: TRAP: FailedAssertion("HaveRegisteredOrActiveSnapshot()", File: "toast_internals.c", Line: 670, PID: 19403)
Previous Message bucoo@sohu.com 2022-04-15 10:06:25 Re: Re: fix cost subqueryscan wrong parallel cost