pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Jim C. Nasby <decibel@decibel.org>
Cc: Alvaro Herrera <alvherre@dcc.uchile.cl>
Cc: Josh Berkus <josh@agliodbs.com>
Cc: Michael Fuhr <mike@fuhr.org>
Cc: pgsql-performance@postgresql.org
Subject: Re: Functionscan estimates
Date: Sat, 09 Apr 2005 11:45:23 -0400
Message-ID: <22291.1113061523@sss.pgh.pa.us> (raw)
In-Reply-To: <20050409152257.GG93835@decibel.org>
References: <200504081515.50340.josh@agliodbs.com>
	<20050408223820.GA17450@winnie.fuhr.org>
	<20050408224556.GC19458@dcc.uchile.cl>
	<200504081604.27845.josh@agliodbs.com>
	<20050408235731.GA6279@dcc.uchile.cl>
	<19038.1113019256@sss.pgh.pa.us>
	<20050409152257.GG93835@decibel.org>

"Jim C. Nasby" <decibel@decibel.org> writes:
> On Sat, Apr 09, 2005 at 12:00:56AM -0400, Tom Lane wrote:
>> But with all due respect to Joe, I think the reason that stuff got
>> trimmed is that it didn't work very well.  In most cases it's
>> *hard* to write an estimator for a SRF.  Let's see you produce
>> one for dblink() for instance ...

> Actually, if the remote database supported a way to get a rows estimate
> from the query passed to db_link, it would be trivial, since you'd just
> pass that back.

This assumes that (1) you have the complete query argument at the time
of estimation, and (2) it's OK to contact the remote database and do an
EXPLAIN at that time.  Both of these seem pretty shaky assumptions.

The larger point is that writing an estimator for an SRF is frequently a
task about as difficult as writing the SRF itself, and sometimes much
*more* difficult due to lack of information.  I don't foresee a whole
lot of use of an estimator hook designed as proposed here.  In
particular, if the API is such that we can only use the estimator when
all the function arguments are plan-time constants, it's not going to be
very helpful.

			regards, tom lane



view thread (13+ messages)  latest in thread

Message-ID: <22291.1113061523@sss.pgh.pa.us>
Permalink:  ../22291.1113061523@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/22291.1113061523@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, decibel@decibel.org, alvherre@dcc.uchile.cl, josh@agliodbs.com, mike@fuhr.org
  Subject: Re: Functionscan estimates
  In-Reply-To: <22291.1113061523@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox