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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: David Rowley <dgrowleyml(at)gmail(dot)com>
Cc: 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: 2022-07-07 03:50:48
Message-ID: 2740652.1657165848@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

David Rowley <dgrowleyml(at)gmail(dot)com> writes:
> Anyway, I've no current plans to take the attached any further. I
> think it'll be better to pursue your NULLable-Var stuff and see if we
> can do something more generic like remove provably redundant NullTests
> from baserestrictinfo.

Yeah, I suspect that the way forward is to allow
preprocess_minmax_aggregates to do what it does now, and then
remove the IS NOT NULL clause again later when we have the
info available to let us do that in a generic way.

In any case, as you said, it's just a band-aid that happens to
help in this exact scenario. It's not doing much for the bad
cost estimation that's the root of the problem.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Andres Freund 2022-07-07 04:36:56 Re: BUG #17540: Prepared statement: PG switches to a generic query plan which is consistently much slower
Previous Message David Rowley 2022-07-07 03:31:30 Re: BUG #17540: Prepared statement: PG switches to a generic query plan which is consistently much slower

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2022-07-07 04:36:56 Re: BUG #17540: Prepared statement: PG switches to a generic query plan which is consistently much slower
Previous Message wangw.fnst@fujitsu.com 2022-07-07 03:47:39 RE: Perform streaming logical transactions by background workers and parallel apply