pg.ddx.io  pgsql-bugs@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: xinwen@stu.scu.edu.cn
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #17826: An assert failed in /src/backend/optimizer/util/var.c
Date: Thu, 16 Mar 2023 23:34:14 -0400
Message-ID: <4087060.1679024054@sss.pgh.pa.us> (raw)
In-Reply-To: <CAApHDvrzEw6p7W_CDgGw1raP1WpUAp5sc7BiYC4CwWkeY9mPhw@mail.gmail.com>
References: <17826-7d8750952f19a5f5@postgresql.org>
	<402866.1678378153@sss.pgh.pa.us>
	<CAApHDvoGAu9rY4iO0R+DZVxPck_M3015WUL_34XOhi9ygxYfnA@mail.gmail.com>
	<1229467.1678555436@sss.pgh.pa.us>
	<CAApHDvoaExj=YiOJ4PpbshPnOV5d95HQAGJeh44HPQW6Nns-8A@mail.gmail.com>
	<1616392.1678657435@sss.pgh.pa.us>
	<CAApHDvoKryODcxkGGHihK6q_d-_09mQJqCwnVv6pjLM4xU3R2Q@mail.gmail.com>
	<3962534.1678993174@sss.pgh.pa.us>
	<CAApHDvrzEw6p7W_CDgGw1raP1WpUAp5sc7BiYC4CwWkeY9mPhw@mail.gmail.com>

David Rowley <dgrowleyml@gmail.com> writes:
> I kinda also wanted to do the attached so that the logic to push or
> not to push was more centralised.  I just couldn't figure out exactly
> why we don't push down pseudoconstant quals, therefore, was unable to
> document that sufficiently in the header comment in
> qual_is_pushdown_safe().

A pseudoconstant qual turns into a filtering Result node with a one-time
condition that controls whether it runs the child plan at all.  You want
to put those as high in the plan tree as possible, so that they cut off
the maximum possible amount of work when the one-time condition is false.
So pushing one down into a subplan would be downright counterproductive.

			regards, tom lane





view thread (10+ messages)

Message-ID: <4087060.1679024054@sss.pgh.pa.us>
Permalink:  ../4087060.1679024054@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/4087060.1679024054@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-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, dgrowleyml@gmail.com, xinwen@stu.scu.edu.cn, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #17826: An assert failed in /src/backend/optimizer/util/var.c
  In-Reply-To: <4087060.1679024054@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