Re: Properly pathify the union planner
Richard Guo <guofenglinux@gmail.com>
From: Richard Guo <guofenglinux@gmail.com>
To: David Rowley <dgrowleyml@gmail.com>
Cc: PostgreSQL Developers <pgsql-hackers@lists.postgresql.org>
Date: 2024-03-25T06:05:07Z
Lists: pgsql-hackers
On Mon, Mar 25, 2024 at 9:44 AM David Rowley <dgrowleyml@gmail.com> wrote: > It seems ok that > the ec_indexes are not set for the top-level set RelOptInfo as > get_eclass_for_sort_expr() does not make use of ec_indexes while > searching for an existing EquivalenceClass. Maybe we should fix this > varno == 0 hack and adjust get_eclass_for_sort_expr() so that it makes > use of the ec_indexes. > > It's possible to see this happen with a query such as: > > SELECT oid FROM pg_class UNION SELECT oid FROM pg_class ORDER BY oid; I see what you said. Yeah, there might be some optimization possibilities in this area. And I agree that this should not be a blocker in pushing this patch. > I didn't see that as a reason not to push this patch as this occurs > both with and without this change, so I've now pushed this patch. Great to see this patch has been pushed! Thanks Richard
Commits
-
Don't adjust ressortgroupref in generate_setop_child_grouplist()
- 7487044d6ccf 17.0 landed
-
Don't zero tuple_fraction when planning UNIONs with ORDER BYs
- 3b1a7eb28930 17.0 landed
-
Fix assert failure when planning setop subqueries with CTEs
- d5d2205c8ddc 17.0 landed
-
Allow planner to use Merge Append to efficiently implement UNION
- 66c0185a3d14 17.0 landed
-
Simplify PathKey checking code
- 0c444a70f2a7 17.0 landed
-
Clarify the 'rows' parameter in create_append_path
- 87027cb55bf7 17.0 landed