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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Simon Riggs <simon(at)2ndquadrant(dot)com>, pgsql-committers(at)postgresql(dot)org, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [HACKERS] Re: pgsql: Add missing optimizer hooks for function cost and number of rows.
Date: 2010-04-24 15:17:04
Message-ID: 6802.1272122224@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> On Sat, Apr 24, 2010 at 3:31 AM, Simon Riggs <simon(at)2ndquadrant(dot)com> wrote:
>> Existing hooks were not fully complete in their coverage. That has
>> happened before, and we have discussed that before on hackers, so I took
>> care not to deviate from that implementation. This is a very low impact
>> change, isn't in a new area and similar optimizer related changes were
>> made recently, so I saw little to object to in this particular change.
>> No such hooks are documented, even ones with strong use cases.

> The point isn't whether the existing hooks are complete or not. The
> point is that we shouldn't be making undiscussed changes EVER, and
> particularly not a week before beta.

I have a problem with not only the process (or lack of it) but the
substance of the patch. I don't believe that a system-wide hook point
has any great use for improving function estimation. You need function-
specific knowledge, and this is just not a useful way to package it.

When we put in the COST/ROWS options for functions, it was generally
agreed that the way forward would be to generalize those, eg by allowing
per-function estimator functions to be called instead of just inserting
constants. (And I think the main reason we didn't just do that
immediately was that we wanted a feature that could be used without
doing C-level programming.) This patch doesn't do that, nor even lay
any useful groundwork for doing it. It would be impossible for instance
for this hook function to lay its hands on the arguments to the function
to be estimated, which certainly begs the question as to how it's going
to deliver any estimate more useful than the constant value.

Please revert.

regards, tom lane

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Simon Riggs 2010-04-24 16:20:32 pgsql: Patch revoked because of objections.
Previous Message Robert Haas 2010-04-24 11:10:13 Re: [HACKERS] Re: pgsql: Add missing optimizer hooks for function cost and number of rows.

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Sabino Mullane 2010-04-24 16:02:33 Re: global temporary tables
Previous Message Terry Brown 2010-04-24 14:05:37 Re: psql: Add setting to make '+' on \d implicit