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
Views: Raw Message | Whole Thread | Download mbox | Resend email
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

Browse pgsql-hackers by date

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