Re: fix cost subqueryscan wrong parallel cost - Mailing list pgsql-hackers

From Justin Pryzby
Subject Re: fix cost subqueryscan wrong parallel cost
Date
Msg-id 20220415101059.GW26620@telsasoft.com
Whole thread Raw
In response to Re: fix cost subqueryscan wrong parallel cost  (Richard Guo <guofenglinux@gmail.com>)
List 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



pgsql-hackers by date:

Previous
From: "bucoo@sohu.com"
Date:
Subject: Re: Re: fix cost subqueryscan wrong parallel cost
Next
From: Robert Haas
Date:
Subject: Re: TRAP: FailedAssertion("HaveRegisteredOrActiveSnapshot()", File: "toast_internals.c", Line: 670, PID: 19403)