Skip site navigation (1) Skip section navigation (2)

Re: Avoiding bad prepared-statement plans.

From: Yeb Havinga <yebhavinga(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Mark Mielke <mark(at)mark(dot)mielke(dot)cc>, Jeroen Vermeulen <jtv(at)xs4all(dot)nl>, Alex Hunsaker <badalex(at)gmail(dot)com>, Greg Stark <gsstark(at)mit(dot)edu>, Bart Samwel <bart(at)samwel(dot)tk>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Avoiding bad prepared-statement plans.
Date: 2010-02-26 20:11:16
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
Tom Lane wrote:
> Right, but if the parameter is unknown then its distribution is also
> unknown.  In any case that's just nitpicking, because the solution is
> to create a custom plan for the specific value supplied.  Or are you
> suggesting that we should create a way for users to say "here is the
> expected distribution of this parameter", and then try to fold that into
> the planner estimates?
Or instead of letting users give the distribution, gather it 
automatically in some plan statistics catalog? I suspect in most 
applications queries stay the same for months and maybe years, so after 
some number of iterations it is possible to have decent call statistics 
/ parameter distributions. Maybe the the parameter value distribution 
could even be annotated with actual cached plans.

Yeb Havinga

In response to


pgsql-hackers by date

Next:From: Teodor SigaevDate: 2010-02-26 20:12:25
Subject: Re: [BUGS] BUG #5021: ts_parse doesn't recognize email addresses with underscores
Previous:From: Greg StarkDate: 2010-02-26 20:10:11
Subject: Re: Hot Standby query cancellation and Streaming Replication integration

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group