Re: generalizing the planner knobs - Mailing list pgsql-hackers

From Greg Stark
Subject Re: generalizing the planner knobs
Date
Msg-id 87d5kgf002.fsf@stark.xeocode.com
Whole thread Raw
In response to Re: generalizing the planner knobs  ("Pollard, Mike" <mpollard@cincom.com>)
Responses Re: generalizing the planner knobs
List pgsql-hackers
"Pollard, Mike" <mpollard@cincom.com> writes:

> Optimizer hints were added because some databases just don't have a very
> smart optimizer.  But you are much better served tracking down cases in
> which the optimizer makes a bad choice, and teaching the optimizer how
> to make a better one.  

You more or less missed my entire point.

You can always teach the optimizer to make better decisions based on good
data. Your statement is basically right when talking about tweaking the
optimizer's decisions to ignore its best judgement.

But there are many many cases where the data the optimizer has available isn't
good and for good reason. And in plenty of those cases the data the optimizer
has available *can't* be good.

In the extreme, no amount of added intelligence in the optimizer is going to
help it come up with any sane selectivity estimate for something like 
 WHERE radius_authenticate(user) = 'OK'

-- 
greg



pgsql-hackers by date:

Previous
From: Trent Shipley
Date:
Subject: Re: generalizing the planner knobs
Next
From: Tom Lane
Date:
Subject: Re: Fork-based version of pgbench