explain analyzing a query inside an sql stored procedure

From: Havasvölgyi Ottó <h(dot)otto(at)freemail(dot)hu>
To: <pgsql-general(at)postgresql(dot)org>
Subject: explain analyzing a query inside an sql stored procedure
Date: 2005-08-04 11:02:31
Message-ID: 005f01c598e4$02db2950$8200a8c0@OTTO
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

Is there any easy way to explain analyze a query, which is inside an sql
stored procedure? I could of course copy the query out of the procedure, and
explain analyze it but this is a slower process. I would do this with a lot
of procedures, that's why it should be fast.

create function myquery() returns setof record as $$
select * from mytable; --this is a set returning query
$$ language sql;

explain analyze select * from myquery();

For me this shows function scan, and not the plan of the query itself.

Best Regards,
Otto

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Oluwatope Akinniyi 2005-08-04 11:03:03 Trigger Variables
Previous Message Alejandro D. Burne 2005-08-04 10:56:32 pgsql-odbc list problem