Re: BUG #17540: Prepared statement: PG switches to a generic query plan which is consistently much slower

From: David Rowley <dgrowleyml(at)gmail(dot)com>
To: Richard Guo <guofenglinux(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, william(dot)duclot(at)gmail(dot)com, PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: BUG #17540: Prepared statement: PG switches to a generic query plan which is consistently much slower
Date: 2023-09-28 03:51:38
Message-ID: CAApHDvpsgqopTiEFv5HoMkevAmxKapwxm6188U=KthZWWfAQ=w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

On Thu, 28 Sept 2023 at 16:22, Richard Guo <guofenglinux(at)gmail(dot)com> wrote:
> It seems that optimizing IS NULL quals is more complex than optimizing
> IS NOT NULL quals. I also wonder if it's worth the trouble to optimize
> IS NULL quals.

I'm happy to reduce the scope of this patch. As for what to cut, I
think if we're doing a subset then we should try to do that subset in
a way that best leaves things open for phase 2 at some later date.

In my view, it would be less surprising that this works for base quals
and not join quals than if it worked with "Var IS NOT NULL" but not
"Var IS NULL". I'm unsure if my view is clouded by the fact that I
don't have a clear picture in my head on how this should work for join
quals, however.

Would it be surprising if this didn't work for join quals? My
thoughts are probably not any more so than the fact that extended
statistics only work for base quals and not join quals, but I'm sure
other people will have different views on that. I don't feel like we
should end up with exactly nothing committed from this patch solely
due to scope creep.

David

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Alexander Lakhin 2023-09-28 05:00:00 Re: BUG #18135: Incorrect memory access occurs when attaching a partition with an index
Previous Message Michael Paquier 2023-09-28 03:30:39 Re: BUG #18135: Incorrect memory access occurs when attaching a partition with an index

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2023-09-28 03:54:33 Re: [PGdocs] fix description for handling pf non-ASCII characters
Previous Message jacktby jacktby 2023-09-28 03:45:34 Re: Set enable_seqscan doesn't take effect?