pg.ddx.io pgsql-docs@postgresql.org mailing list archive
help / color / mirror / Atom feedPREPARE and GUC plan_cache_mode
4+ messages / 2 participants
[nested] [flat]
Commits from this thread:
2019-09-30 ce734aaec1 ca0b382850 Doc: improve PREPARE documentation, cross-referencing to plan_cache_mode.
* PREPARE and GUC plan_cache_mode
@ 2019-09-30 15:55 Bruce Momjian <bruce@momjian.us>
2019-09-30 16:05 ` Re: PREPARE and GUC plan_cache_mode Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 4+ messages in thread
From: Bruce Momjian @ 2019-09-30 15:55 UTC (permalink / raw)
To: pgsql-docs
Our current docs have this text for PREPARE:
Prepared statements can use generic plans rather than re-planning
with each set of supplied EXECUTE values. This occurs immediately
for prepared statements with no parameters; otherwise it occurs
only after five or more executions produce plans whose estimated
cost average (including planning overhead) is more expensive than
the generic plan cost estimate. Once a generic plan is chosen, it
is used for the remaining lifetime of the prepared statement. Using
EXECUTE values which are rare in columns with many duplicates can
generate custom plans that are so much cheaper than the generic
plan, even after adding planning overhead, that the generic plan
might never be used.
There is no mention that PG 12's plan_cache_mode can modify this
behavior. I think this needs a doc patch.
--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com
+ As you are, so once was I. As I am, so you will be. +
+ Ancient Roman grave inscription +
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: PREPARE and GUC plan_cache_mode
2019-09-30 15:55 PREPARE and GUC plan_cache_mode Bruce Momjian <bruce@momjian.us>
@ 2019-09-30 16:05 ` Tom Lane <tgl@sss.pgh.pa.us>
2019-09-30 16:47 ` Re: PREPARE and GUC plan_cache_mode Bruce Momjian <bruce@momjian.us>
0 siblings, 1 reply; 4+ messages in thread
From: Tom Lane @ 2019-09-30 16:05 UTC (permalink / raw)
To: Bruce Momjian <bruce@momjian.us>; +Cc: pgsql-docs
Bruce Momjian <bruce@momjian.us> writes:
> Our current docs have this text for PREPARE:
> Prepared statements can use generic plans rather than re-planning
> with each set of supplied EXECUTE values. This occurs immediately
> for prepared statements with no parameters; otherwise it occurs
> only after five or more executions produce plans whose estimated
> cost average (including planning overhead) is more expensive than
> the generic plan cost estimate. Once a generic plan is chosen, it
> is used for the remaining lifetime of the prepared statement. Using
> EXECUTE values which are rare in columns with many duplicates can
> generate custom plans that are so much cheaper than the generic
> plan, even after adding planning overhead, that the generic plan
> might never be used.
> There is no mention that PG 12's plan_cache_mode can modify this
> behavior. I think this needs a doc patch.
Yeah, agreed. I can do it, or do you want to?
regards, tom lane
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: PREPARE and GUC plan_cache_mode
2019-09-30 15:55 PREPARE and GUC plan_cache_mode Bruce Momjian <bruce@momjian.us>
2019-09-30 16:05 ` Re: PREPARE and GUC plan_cache_mode Tom Lane <tgl@sss.pgh.pa.us>
@ 2019-09-30 16:47 ` Bruce Momjian <bruce@momjian.us>
2019-09-30 17:18 ` Re: PREPARE and GUC plan_cache_mode Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 4+ messages in thread
From: Bruce Momjian @ 2019-09-30 16:47 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-docs
On Mon, Sep 30, 2019 at 12:05:07PM -0400, Tom Lane wrote:
> Bruce Momjian <bruce@momjian.us> writes:
> > Our current docs have this text for PREPARE:
> > Prepared statements can use generic plans rather than re-planning
> > with each set of supplied EXECUTE values. This occurs immediately
> > for prepared statements with no parameters; otherwise it occurs
> > only after five or more executions produce plans whose estimated
> > cost average (including planning overhead) is more expensive than
> > the generic plan cost estimate. Once a generic plan is chosen, it
> > is used for the remaining lifetime of the prepared statement. Using
> > EXECUTE values which are rare in columns with many duplicates can
> > generate custom plans that are so much cheaper than the generic
> > plan, even after adding planning overhead, that the generic plan
> > might never be used.
>
> > There is no mention that PG 12's plan_cache_mode can modify this
> > behavior. I think this needs a doc patch.
>
> Yeah, agreed. I can do it, or do you want to?
Uh, I am feeling I can't do anything with the tree until Friday because
of the PG 12 packaging, right?
--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com
+ As you are, so once was I. As I am, so you will be. +
+ Ancient Roman grave inscription +
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: PREPARE and GUC plan_cache_mode
2019-09-30 15:55 PREPARE and GUC plan_cache_mode Bruce Momjian <bruce@momjian.us>
2019-09-30 16:05 ` Re: PREPARE and GUC plan_cache_mode Tom Lane <tgl@sss.pgh.pa.us>
2019-09-30 16:47 ` Re: PREPARE and GUC plan_cache_mode Bruce Momjian <bruce@momjian.us>
@ 2019-09-30 17:18 ` Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 4+ messages in thread
From: Tom Lane @ 2019-09-30 17:18 UTC (permalink / raw)
To: Bruce Momjian <bruce@momjian.us>; +Cc: pgsql-docs
Bruce Momjian <bruce@momjian.us> writes:
> On Mon, Sep 30, 2019 at 12:05:07PM -0400, Tom Lane wrote:
>> Yeah, agreed. I can do it, or do you want to?
> Uh, I am feeling I can't do anything with the tree until Friday because
> of the PG 12 packaging, right?
There's not a freeze on docs, as far as I'm concerned. I'm working
on it right now.
regards, tom lane
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2019-09-30 17:18 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-09-30 15:55 PREPARE and GUC plan_cache_mode Bruce Momjian <bruce@momjian.us>
2019-09-30 16:05 ` Tom Lane <tgl@sss.pgh.pa.us>
2019-09-30 16:47 ` Bruce Momjian <bruce@momjian.us>
2019-09-30 17:18 ` Tom Lane <tgl@sss.pgh.pa.us>
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