Re: Properly pathify the union planner
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: David Rowley <dgrowleyml@gmail.com>
Cc: Richard Guo <guofenglinux@gmail.com>,
Alexander Lakhin <exclusion@gmail.com>,
PostgreSQL Developers <pgsql-hackers@lists.postgresql.org>
Date: 2024-03-28T19:53:39Z
Lists: pgsql-hackers
I wrote: > David Rowley <dgrowleyml@gmail.com> writes: >> Maybe something with "Parameters" in the name? > SubqueryParameters might be OK. Or SubqueryPlannerExtra? > Since this is a bespoke struct that will probably only ever > be used with subquery_planner, naming it after that function > seems like a good idea. On third thought, I'm not at all convinced that we even want to invent this struct as compared to just adding another parameter to subquery_planner. The problem with a struct is what happens the next time we need to add a parameter? If we add yet another function parameter, we can count on the compiler to complain about call sites that didn't get the memo. Adding a field within an existing struct provokes no such warning, leading to situations with uninitialized fields that might accidentally work during testing, but fail the minute they get to the field. If you do want to go this direction, a minimum safety requirement would be to have an ironclad rule that callers memset the whole struct to zero before filling it, so that any not-set fields will at least have predictable values. But I don't see the point really. regards, tom lane
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