pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: David Rowley <dgrowleyml@gmail.com>
Cc: Richard Guo <guofenglinux@gmail.com>
Cc: Alexander Lakhin <exclusion@gmail.com>
Cc: PostgreSQL Developers <pgsql-hackers@lists.postgresql.org>
Subject: Re: Properly pathify the union planner
Date: Thu, 28 Mar 2024 15:53:39 -0400
Message-ID: <3704835.1711655619@sss.pgh.pa.us> (raw)
In-Reply-To: <3703023.1711654574@sss.pgh.pa.us>
References: <CAApHDvpb_63XQodmxKUF8vb9M7CxyUyT4sWvEgqeQU-GB7QFoQ@mail.gmail.com>
	<CAApHDvoV4QgNsXsegaCJQFHK4v8-gE7_DzXmSMgm_Hg+C+4oYg@mail.gmail.com>
	<CAMbWs49J2jv61DsQ_D=JgnuPMjbd1W3WoMw=-DB=zRpGYRh+yA@mail.gmail.com>
	<CAApHDvq05PiyYzqeOwH36_PqDEkz21d6zqPSTdzgx+HGzv5pkA@mail.gmail.com>
	<CAApHDvovdy=tqHD+13CXVNkXjbB0+9F=GcKi9ndkgUhu9cUkSw@mail.gmail.com>
	<CAMbWs48R7Lp0CwcioeyenXHkrWdMfpOkaZ2OStjr7YeftRHe0Q@mail.gmail.com>
	<CAApHDvrMc2tFQFx86T-mrz6g--WNSmhgSDJWgA1xJe+-KnDDcQ@mail.gmail.com>
	<CAMbWs49H5oKvsUM_SrPbrAPkNqabuxHacjWC+Qd77dmVyMyXEQ@mail.gmail.com>
	<CAApHDvqo1rV8O4pMU2-22iTASBXgnm4kbHF6A8_VMqiDR3hG8A@mail.gmail.com>
	<CAApHDvqaJJ0Q-yqTybpqdyMLeGviA3zF2Rghs-zG=dcQh3yP6g@mail.gmail.com>
	<242fc7c6-a8aa-2daf-ac4c-0a231e2619c1@gmail.com>
	<CAApHDvqYa_1HcUM4TjzKqXxuZCgFuwMXqQWwXvwR7ZoDiAknJA@mail.gmail.com>
	<CAMbWs49gWbhSVdX0kT2x5XGKmP5OZerp6VhEA-hM4BvLHxKaqQ@mail.gmail.com>
	<CAApHDvq1mJWSwQwDTcpRpqipsv4grSR+NQ5FWgB6hfK_ZQOJAg@mail.gmail.com>
	<CAMbWs4_efcU0OxWtmJm8uECLoC=cr! ! T+Dwj98FiSXEw8tK10E4Q@mail.gmail.com>
	<3485967.1711594595@sss.pgh.pa.us>
	<CAApHDvqO-YREBHju31bF-_b77Zg4zwNe44UhzRGn1c+GVTTibQ@mail.gmail.com>
	<3703023.1711654574@sss.pgh.pa.us>

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





view thread (27+ messages)  latest in thread

Message-ID: <3704835.1711655619@sss.pgh.pa.us>
Permalink:  ../3704835.1711655619@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/3704835.1711655619@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, dgrowleyml@gmail.com, guofenglinux@gmail.com, exclusion@gmail.com, pgsql-hackers@lists.postgresql.org
  Subject: Re: Properly pathify the union planner
  In-Reply-To: <3704835.1711655619@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox