Re: Prepared statements considered harmful - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Prepared statements considered harmful
Date
Msg-id 3923.1157121049@sss.pgh.pa.us
Whole thread Raw
In response to Re: Prepared statements considered harmful  (Martijn van Oosterhout <kleptog@svana.org>)
Responses Re: Prepared statements considered harmful  ("Jeroen T. Vermeulen" <jtv@xs4all.nl>)
List pgsql-hackers
Martijn van Oosterhout <kleptog@svana.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


pgsql-hackers by date:

Previous
From: mark@mark.mielke.cc
Date:
Subject: Re: Prepared statements considered harmful
Next
From: Tom Lane
Date:
Subject: Re: [PATCHES] DOC: catalog.sgml