Re: Function Stats WAS: Passing arguments to views - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Function Stats WAS: Passing arguments to views
Date
Msg-id 28636.1138996552@sss.pgh.pa.us
Whole thread Raw
In response to Re: Function Stats WAS: Passing arguments to views  (Josh Berkus <josh@agliodbs.com>)
List pgsql-hackers
Josh Berkus <josh@agliodbs.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


pgsql-hackers by date:

Previous
From: Josh Berkus
Date:
Subject: Re: Function Stats WAS: Passing arguments to views
Next
From: "Mark Woodward"
Date:
Subject: Re: Multiple logical databases