Costs estimates for (inline SQL) functions ...

From: Hans-Juergen Schoenig <postgres(at)cybertec(dot)at>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Costs estimates for (inline SQL) functions ...
Date: 2006-08-21 05:31:28
Message-ID: 44E94530.7080306@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

As my last mail did not seem to go through here one more try ...
When looking at some fairly complex SQL stuff I came across some
interesting issue which is a bit surprising to me:

CREATE OR REPLACE FUNCTION xy() RETURNS SETOF record AS $$
SELECT relname::text, relpages::int4
FROM pg_class;
$$ LANGUAGE SQL IMMUTABLE;

explain SELECT * FROM xy() AS (relname text, relpages int4);

hs(at)athlon64:/tmp$ psql test < check.sql
CREATE FUNCTION
QUERY PLAN
------------------------------------------------------------
Function Scan on xy (cost=0.00..12.50 rows=1000 width=36)
(1 row)

As far as i remember inlined SQL code has been implemented into the
planner around 7.4.
This should also be true according to ...

http://conferences.oreillynet.com/cs/os2003/view/e_sess/4372

In my theory the function is inlined and therefore we should see
different costs here (the ones of the "real" query).
Does anybody happen to know more about this issue?

Many thanks,

hans

--
Cybertec Geschwinde & Schönig GmbH
Schöngrabern 134; A-2020 Hollabrunn
Tel: +43/1/205 10 35 / 340
www.postgresql.at, www.cybertec.at

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Neil Conway 2006-08-21 05:56:12 Re: Costs estimates for (inline SQL) functions ...
Previous Message Luke Lonergan 2006-08-21 04:18:16 Re: PostgreSQL on 64 bit Linux