Oversight in CREATE FUNCTION + EXPLAIN? - Mailing list pgsql-hackers

From Joshua D. Drake
Subject Oversight in CREATE FUNCTION + EXPLAIN?
Date
Msg-id 1258582670.20737.105.camel@jd-desktop.iso-8859-1.charter.com
Whole thread Raw
List pgsql-hackers
Hey,

So I ran across this today:

CREATE OR REPLACE FUNCTION RETURN_LOTS(INT) RETURNS SETOF INT AS   $$      SELECT generate_series(1,$1);   $$ 
COST 0.5 ROWS 50 SET work_mem TO '5MB' LANGUAGE 'SQL';

postgres=# explain analyze select return_lots(10000000);
QUERY PLAN                                           
-----------------------------------------------------------------------------------------------Result  (cost=0.00..0.26
rows=1width=0) (actual time=0.059..21411.187
 
rows=10000000 loops=1)Total runtime: 25951.904 ms

Shouldn't the estimated rows be 50?

Joshua D. Drake


-- 
PostgreSQL.org Major Contributor
Command Prompt, Inc: http://www.commandprompt.com/ - 503.667.4564
Consulting, Training, Support, Custom Development, Engineering
If the world pushes look it in the eye and GRR. Then push back harder. - Salamander



pgsql-hackers by date:

Previous
From: Scott Bailey
Date:
Subject: Re: xpath_table equivalent
Next
From: "Joshua D. Drake"
Date:
Subject: Amazing performance failure with SQL function