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