Re: Automatic function replanning

From: "Jim C(dot) Nasby" <jnasby(at)pervasive(dot)com>
To: Lukas Smith <smith(at)pooteeweet(dot)org>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Automatic function replanning
Date: 2005-12-22 21:10:54
Message-ID: 20051222211054.GK72143@pervasive.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Dec 22, 2005 at 09:55:14PM +0100, Lukas Smith wrote:
> Bruce Momjian wrote:
>
> >>Maybe I am mixing up separate concepts (are bound variables and prepared
> >>statements different concepts?) here. I also do not really understand if
> >>that means that oracle does not store a query plan for a prepared query
> >>or if it just does some special handling in case it knows that a
> >>prepared statement column is known to have a highly varying selectivity
> >>per value.
> >
> >What the Oralce manual means I think is that the plan of the query is
> >delayed until the _first_ EXECUTE, so it has some values to use in the
> >optimizer. The problem is that later queries might use constants of
> >greatly different cardinality.
>
> ok .. which just goes to tell to not use prepared statements for a
> column with highly varying selectivity ..?
>
> or is there a realistic shot at fixing this use case?

FWIW, I believe that 10g has some brains in this regard, where it can
detect if it should store multiple plans for one prepared statement.
This is critical for them, because they'r parser/planner is much harder
on the system than ours is.
--
Jim C. Nasby, Sr. Engineering Consultant jnasby(at)pervasive(dot)com
Pervasive Software http://pervasive.com work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2005-12-22 21:11:28 Re: Automatic function replanning
Previous Message David Fetter 2005-12-22 21:06:45 Re: PL/pgSQL proposal: using list of scalars in assign stmts, fore and fors stmts