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

Alvaro, Michael,

> > About a month ago I mentioned that I'd find that useful.  In a
> > followup, Christopher Kings-Lynne brought up the idea of a GUC
> > variable that could give hints about the expected row count.
>
> That seems pretty limited ... what happens if the query contains more
> that one SRF?

Yeah, I'd see that as a pretty bad idea too.  I don't want to tell the planner 
how many rows I expect "all functions" to return, I want to tell it how many 
*one particular* function will return.

> Maybe issuing some sort of special call to the function (say, with
> some boolean in the call info struct) on which it returns planning data;
> thus the planner can call the function itself.  The hard part would be
> figuring out how to do it without breaking backwards compatibility with
> functions that don't know how to handle that.  (And how to do it in
> plpgsql).

Or in pl/perl, or pl/python, or plsh .... doesn't sound feasable.   

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.

-- 
--Josh

Josh Berkus
Aglio Database Solutions
San Francisco



view thread (13+ messages)  latest in thread

Message-ID: <200504081604.27845.josh@agliodbs.com>
Permalink:  ../200504081604.27845.josh@agliodbs.com/
Also on:    postgresql.org/message-id/200504081604.27845.josh@agliodbs.com

 · 

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

* 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