| From: | "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com> |
|---|---|
| To: | pgsql-hackers(at)postgresql(dot)org |
| Subject: | Oversight in CREATE FUNCTION + EXPLAIN? |
| Date: | 2009-11-18 22:17:50 |
| Message-ID: | 1258582670.20737.105.camel@jd-desktop.unknown.charter.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | 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=1 width=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
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Joshua D. Drake | 2009-11-18 22:24:33 | Amazing performance failure with SQL function |
| Previous Message | Tom Lane | 2009-11-18 22:05:34 | Re: Rejecting weak passwords |