Re: Simple join optimized badly? - Mailing list pgsql-performance

From Tom Lane
Subject Re: Simple join optimized badly?
Date
Msg-id 15661.1160534309@sss.pgh.pa.us
Whole thread Raw
In response to Re: Simple join optimized badly?  (Brian Herlihy <btherl@yahoo.com.au>)
Responses Re: Simple join optimized badly?  (Brian Herlihy <btherl@yahoo.com.au>)
Re: Simple join optimized badly?  ("Bucky Jordan" <bjordan@lumeta.com>)
Re: Simple join optimized badly?  (Mark Lewis <mark.lewis@mir3.com>)
List pgsql-performance
Brian Herlihy <btherl@yahoo.com.au> writes:
> What would it take for hints to be added to postgres?

A *whole lot* more thought and effort than has been expended on the
subject to date.

Personally I have no use for the idea of "force the planner to do
exactly X given a query of exactly Y".  You don't have exactly Y
today, tomorrow, and the day after (if you do, you don't need a
hint mechanism at all, you need a mysql-style query cache).
IMHO most of the planner mistakes we see that could be fixed via
hinting are really statistical estimation errors, and so the right
level to be fixing them at is hints about how to estimate the number
of rows produced for given conditions.  Mind you that's still a plenty
hard problem, but you could at least hope that a hint of that form
would be useful for more than one query.

            regards, tom lane

pgsql-performance by date:

Previous
From: Brian Herlihy
Date:
Subject: Re: Simple join optimized badly?
Next
From: Tom Lane
Date:
Subject: Re: Scrub one large table against another