Skip site navigation (1) Skip section navigation (2)

Re: Prepared statements considered harmful

From: Theo Schlossnagle <jesus(at)omniti(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Cc: Theo Schlossnagle <jesus(at)omniti(dot)com>, Merlin Moncure <mmoncure(at)gmail(dot)com>, Peter Eisentraut <peter_e(at)gmx(dot)net>
Subject: Re: Prepared statements considered harmful
Date: 2006-08-31 14:09:10
Message-ID: D53123EA-62B4-4883-AE21-2227AE137E82@omniti.com (view raw or flat)
Thread:
Lists: pgsql-hackers
On Aug 31, 2006, at 9:25 AM, Peter Eisentraut wrote:

> Am Donnerstag, 31. August 2006 15:05 schrieb Merlin Moncure:
>> The proposal to supply hints to statements and functions has been
>> voted down several times due to the argument that it is better to fix
>> the planner.  I think supplying hints does fix the planner, and is a
>> balanced solution.
>
> Planner hints are a way to address a deficient planner.  But neither a
> manually hinted planner nor a perfectly good planner will help if the
> planning decisions are based on outdated information.

I don't chime in very often, but I do think the refusal to  
incorporate hints into the planner system is fantastically stubborn  
and nonsensical.  I whole-heartedly agree that it is _better_ to fix  
the planner, but many of us have production systems and can't just go  
check out CVS HEAD to address our day-to-day issues and we suffer  
from this decision.

There are many databases out there with better planners than  
PostgreSQL -- likely there will always be.  Even those databases have  
query planner hints.  Why?  Because the authors of those database had  
the humility to realize that the planner they designed wasn't perfect  
and that people _still_ need their database to perform well despite a  
non-optimal query plan here and there.

A good query planner hint system would act as a catalyst to the  
improvement of the current query planner as users could share their  
complex queries and associated improved query plans through hinting.

I like Postgres a lot, I think the people that work on it are very  
very sharp.  I do feel that the consistent refusal to allow query  
hinting to be introduced demonstrates an unhealthy amount of hubris  
that, in the end, negatively impacts users.

While Postgres is missing a ton of other needed features, I rarely  
see the attitude that they are _unwanted_.  Instead I see the "if it  
is important to you, go build it" attitude which is what I would  
expect in an open source project.

// Theo Schlossnagle
// CTO -- http://www.omniti.com/~jesus/
// OmniTI Computer Consulting, Inc. -- http://www.omniti.com/



In response to

Responses

pgsql-hackers by date

Next:From: AgentMDate: 2006-08-31 14:15:02
Subject: Re: Prepared statements considered harmful
Previous:From: Tom LaneDate: 2006-08-31 13:55:53
Subject: Re: [HACKERS] Updatable views

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group