> > 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 ---------------------------(end of broadcast)--------------------------- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq