Skip site navigation (1) Skip section navigation (2)

Re: Function Stats WAS: Passing arguments to views

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: josh(at)agliodbs(dot)com
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Function Stats WAS: Passing arguments to views
Date: 2006-02-03 19:55:52
Message-ID: 28636.1138996552@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers
Josh Berkus <josh(at)agliodbs(dot)com> writes:
>> I'm not thrilled with putting in a stopgap that we will have to support
>> forever.  The constant method is *clearly* inadequate for many (probably
>> most IMHO) practical cases.  Where do you see it being of use?

> Well, mostly for the real-world use cases where I've run into SRF estimate 
> issues, which have mostly been SRFs which return one row.

Well, if they're certain to return one row, you can just declare them as
not SETOF, no?  Since 8.1 we do get that case right:

regression=# explain select * from cos(0);
                       QUERY PLAN
--------------------------------------------------------
 Function Scan on cos  (cost=0.00..0.01 rows=1 width=8)
(1 row)


> No, but if you're calling the S() estimator in the context of performing a 
> join, what do you supply for parameters?

Exactly my point about the API problem.  I'm not sure that joins matter,
but the function parameters sure do, and those might not be simple constants.

			regards, tom lane

In response to

pgsql-hackers by date

Next:From: Mark DilgerDate: 2006-02-03 20:09:01
Subject: Re: Function Stats WAS: Passing arguments to views
Previous:From: Josh BerkusDate: 2006-02-03 19:49:06
Subject: Re: Function Stats WAS: Passing arguments to views

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group