pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@dcc.uchile.cl>
To: Josh Berkus <josh@agliodbs.com>
Cc: Michael Fuhr <mike@fuhr.org>
Cc: pgsql-performance@postgresql.org
Subject: Re: Functionscan estimates
Date: Fri, 8 Apr 2005 19:57:31 -0400
Message-ID: <20050408235731.GA6279@dcc.uchile.cl> (raw)
In-Reply-To: <200504081604.27845.josh@agliodbs.com>
References: <200504081515.50340.josh@agliodbs.com>
	<20050408223820.GA17450@winnie.fuhr.org>
	<20050408224556.GC19458@dcc.uchile.cl>
	<200504081604.27845.josh@agliodbs.com>

On Fri, Apr 08, 2005 at 04:04:27PM -0700, Josh Berkus wrote:

> My solution would be a lot simpler, since we could simply populate 
> pg_proc.proestrows with "1000" by default if not changed by the DBA.  In an 
> even better world, we could tie it to a table, saying that, for example, 
> proestrows = my_table*0.02.

The problem with that approach is that it can't differ depending on the
arguments to the function, so it too seems limited to me.

Ideally an estimator would be able to peek at other table statistics and
do some computation with them, just like other nodes are able to.

Another idea would be have an estimator function (pg_proc.proestimator)
for each regular function.  The estimator would be a very cheap function
to be called with the same arguments, and it would return the estimated
number of tuples the other function would return.  The default estimator
could be "return 1000".

-- 
Alvaro Herrera (<alvherre[@]dcc.uchile.cl>)
"A wizard is never late, Frodo Baggins, nor is he early.
 He arrives precisely when he means to."  (Gandalf, en LoTR FoTR)



view thread (13+ messages)  latest in thread

Message-ID: <20050408235731.GA6279@dcc.uchile.cl>
Permalink:  ../20050408235731.GA6279@dcc.uchile.cl/
Also on:    postgresql.org/message-id/20050408235731.GA6279@dcc.uchile.cl

 · 

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: alvherre@dcc.uchile.cl, josh@agliodbs.com, mike@fuhr.org
  Subject: Re: Functionscan estimates
  In-Reply-To: <20050408235731.GA6279@dcc.uchile.cl>

* 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