Re: BUG #17540: Prepared statement: PG switches to a generic query plan which is consistently much slower
David Rowley <dgrowleyml@gmail.com>
From: David Rowley <dgrowleyml@gmail.com>
To: Richard Guo <guofenglinux@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, william.duclot@gmail.com, PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Date: 2023-09-28T03:51:38Z
Lists: pgsql-bugs, pgsql-hackers
On Thu, 28 Sept 2023 at 16:22, Richard Guo <guofenglinux@gmail.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
Commits
-
Add better handling of redundant IS [NOT] NULL quals
- b262ad440ede 17.0 landed