Re: Avoiding bad prepared-statement plans.
Alex Hunsaker <badalex@gmail.com>
From: Alex Hunsaker <badalex@gmail.com>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, Jeroen Vermeulen <jtv@xs4all.nl>, Greg Stark <gsstark@mit.edu>, Bart Samwel <bart@samwel.tk>, Pavel Stehule <pavel.stehule@gmail.com>, pgsql-hackers@postgresql.org
Date: 2010-02-26T20:02:40Z
Lists: pgsql-hackers
On Fri, Feb 26, 2010 at 09:50, Robert Haas <robertmhaas@gmail.com> wrote: > On Fri, Feb 26, 2010 at 1:29 AM, Alex Hunsaker <badalex@gmail.com> wrote: >> Prepared plans + exec plan (new guc/ protocol thing): >> Use: not quite sure >> Problems: slow because it would replan every time >> Solutions: use a prepared plan with the appropriate things not >> parametrized...? >> >> [ aka we already have this, its called dont use a prepared statement ] > > The point is sometimes you'd like to replan every time, but not > reparse every time. There's no way to do that ATM. So what you save on parse time? Maybe that's worth it. I've never run the numbers nor have I seen them in this thread. I probably missed em... My _hunch_ is planning will on average take significantly longer than parse time (read in the noise of plan time). But that's unfounded :) I can certainly imagine cases where you have HUGE queries where the parse time too slow-- wont the plan most of the time be an order of magnitude slower? Anyway Ill stop until I get a chance to do _some_ kind of benchmarking, I'm really quite clueless here.