Discussion:
Optimizing complex plgsql SP
(too old to reply)
Chris McDonald
2013-02-27 10:30:26 UTC
Permalink
Hi,

I have a complex plpgsql query which makes many SQL calls, other SP calls (also plpgsql) and on occasion recurses on itself also. Many of the SQL queries it contains make joins on multi-million row tables.

The SP performs well on some occasions (couple of seconds) but on others performs poorly (15-20 seconds). I know from the data-domain that the poor performance occurs when there is significantly larger data volumes to process.

Ideally I would like to see the individual queries being executed but pgadmin only shows me the top level SP executing. Is there a way that I can see the individual queries within the SP executing together with timings (and ideally plan details)?

Thanks very much in advance.

Chris
Chris McDonald
2013-02-27 10:32:00 UTC
Permalink
My apologies - forgot to say that this is all postgresql 8.4.9 on Fedora 14 x X64.

chris
Post by Chris McDonald
Hi,
I have a complex plpgsql query which makes many SQL calls, other SP calls (also plpgsql) and on occasion recurses on itself also. Many of the SQL queries it contains make joins on multi-million row tables.
The SP performs well on some occasions (couple of seconds) but on others performs poorly (15-20 seconds). I know from the data-domain that the poor performance occurs when there is significantly larger data volumes to process.
Ideally I would like to see the individual queries being executed but pgadmin only shows me the top level SP executing. Is there a way that I can see the individual queries within the SP executing together with timings (and ideally plan details)?
Thanks very much in advance.
Chris
Loading...