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

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Re: Prepared statements considered harmful



> > How about "prepared" means really "prepared"... in the sense of 
> > parsed, analyzed all sensible plans, and save a meta-plan which
based 
> > on current statistics and parameter values chooses one of the 
> > considered (and cached) plans ?
> 
> I don't think this could solve one particularly frequent 
> problem which is that pattern matching queries don't get 
> along with prepared plans if the search pattern isn't known 
> at planning time.

I think what we would actually want is knowledge about how
much difference different parameters actually make in plan decision.
(the stats show an even distribution and join correlation) 
Then we could prepare the plan when there is not much difference
and postpone planning until we know the parameters when the difference
is big.

OLTP workload typically benefits from prepared plans, and the one plan
is good 
for all possible inputs, so imho we cannot just assume all plans need
replanning
for different parameters.

Andreas



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group