Re: [HACKERS] Re: pgsql: Add missing optimizer hooks for function cost and number of rows. - Mailing list pgsql-committers

From Simon Riggs
Subject Re: [HACKERS] Re: pgsql: Add missing optimizer hooks for function cost and number of rows.
Date
Msg-id 1272129226.4161.1596.camel@ebony
Whole thread Raw
In response to Re: [HACKERS] Re: pgsql: Add missing optimizer hooks for function cost and number of rows.  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-committers
On Sat, 2010-04-24 at 12:59 -0400, Tom Lane wrote:

> Well, you did it without much thought at all.

To the consequences, definitely.

> I think this episode is a
> perfect demonstration of why we ask for concrete use-cases for proposed
> hooks.  If you'd actually tried to write something that used the hook,
> you'd surely have noticed that it wasn't being passed the information
> that it would need to do anything useful, and you'd probably have
> recognized the problem that there's no good way for a single hook
> function to provide an extensible collection of function-specific
> knowledge.

To the value, no. The limitations of the hook approach were clear, but
they do at least allow overriding values on a session by session basis,
allowing you to write a program to estimate the result and then set the
function costs accordingly. It's not clever or the best way, but it was
the same situation as the other hooks currently provide and I imagined
it would be accepted without question, wrongly.

--
 Simon Riggs           www.2ndQuadrant.com


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] Re: pgsql: Add missing optimizer hooks for function cost and number of rows.
Next
From: momjian@postgresql.org (Bruce Momjian)
Date:
Subject: pgsql: Add C comments for recent to_char('L') fix for Win32.