"David Johnston" <polobo@xxxxxxxxx> writes: > So, > EXPLAIN SELECT function_call(...) -- yields a planner expectation of 1 row > [Whereas] > EXPLAIN SELECT * FROM function_call(...) -- yields a planner expectation of > "result_rows" which defaults to 1000 Hm ... > Was this an intentional design decision to override the result_rows estimate > of the function if it is used in the select list? Not so much an intentional decision as just that nobody ever did anything about it. In general, SRFs in the target list are considered a legacy feature, which we're going to deprecate as soon as we have LATERAL so that there's a better-defined substitute. So I'd not want to expend a lot of work on this. But it probably would be possible to extract the row count estimates nearly for free while extracting the target list's cost estimate, which we already have to make a pass over the expressions for. Let me go look at that ... regards, tom lane -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general