Re: Prepared statements considered harmful

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Martijn van Oosterhout <kleptog(at)svana(dot)org>
Cc: "Jeroen T(dot) Vermeulen" <jtv(at)xs4all(dot)nl>, Phil Frost <indigo(at)bitglue(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Prepared statements considered harmful
Date: 2006-09-01 14:30:49
Message-ID: 3923.1157121049@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Martijn van Oosterhout <kleptog(at)svana(dot)org> writes:
> Interesting thought. It might be worth trying. But my big question: is
> all this testing and counting actually going to be faster than just
> replanning? Postgresql's planner is not that slow.
> ...
> The thing is that number of possible plans is going to be proportional
> to factorial(number of tables).

Yeah. One of the reasons the planner is acceptably fast is that it is
aggressive about discarding candidate plans as soon as they are clearly
inferior to other plans. Tracking multiple plans that might be optimal
under varying assumptions about the query parameters would make things
exponentially slower.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bricklen Anderson 2006-09-01 14:39:45 Re: [pgsql-advocacy] Thought provoking piece on NetBSD
Previous Message mark 2006-09-01 14:28:00 Re: Prepared statements considered harmful