Re: BUG #17826: An assert failed in /src/backend/optimizer/util/var.c - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #17826: An assert failed in /src/backend/optimizer/util/var.c
Date
Msg-id 4087060.1679024054@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #17826: An assert failed in /src/backend/optimizer/util/var.c  (David Rowley <dgrowleyml@gmail.com>)
List pgsql-bugs
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



pgsql-bugs by date:

Previous
From: David Rowley
Date:
Subject: Re: BUG #17826: An assert failed in /src/backend/optimizer/util/var.c
Next
From: jian he
Date:
Subject: Re: Re: BUG #17845: insert into on conflict bug .