Обсуждение: Oversight in CREATE FUNCTION + EXPLAIN?

Поиск
Список
Период
Сортировка

Oversight in CREATE FUNCTION + EXPLAIN?

От
"Joshua D. Drake"
Дата:
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