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

From Jeroen T. Vermeulen
Subject Re: Prepared statements considered harmful
Date
Msg-id 8464.125.24.219.191.1157029617.squirrel@webmail.xs4all.nl
Whole thread Raw
In response to Prepared statements considered harmful  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: Prepared statements considered harmful
Re: Prepared statements considered harmful
List pgsql-hackers
On Thu, August 31, 2006 18:56, Peter Eisentraut wrote:

> With time, it becomes ever clearer to me that prepared SQL statements are
> just
> a really bad idea.  On some days, it seems like half the performance
> problems
> in PostgreSQL-using systems are because a bad plan was cached somewhere.

Is there any kind of pattern at all to this problem?  Anything
recognizable?  A few typical pitfalls?

Without knowing much of the internals, I could imagine [waves hands in
vague gestures] other options--something like recognizing major changes
that upset the cost functions that went into generating a plan, and
invalidating the plan based on those; or noting bad estimates somehow as
they become apparent during execution, and annotating the plan with a
"this assumption was a bad idea" marker so you'll do better next time.

I guess you can't go far wrong if you re-define "prepared" to mean merely
"pre-parsed," but it sounds like such a waste of opportunity...


Jeroen




pgsql-hackers by date:

Previous
From: "zhou bo"
Date:
Subject: Re: Prepared statements considered harmful
Next
From: Andreas Pflug
Date:
Subject: Re: Prepared statements considered harmful