Re: How to see detailed plan of a funciton

From: Andreas Seltenreich <andreas+pg(at)gate450(dot)dyndns(dot)org>
To: "Obe, Regina DND\\MIS" <robe(dot)dnd(at)cityofboston(dot)gov>
Cc: "'pgsql-novice(at)postgresql(dot)org'" <pgsql-novice(at)postgresql(dot)org>
Subject: Re: How to see detailed plan of a funciton
Date: 2005-12-07 13:53:17
Message-ID: 87iru1hv3m.fsf@gate450.dyndns.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Regina Obe writes:

> I have a pgsql function that returns a set of records and I'm trying to
> optimize it.
>
> Needless to say it goes thru several selects and appends to the final
> result. I was wondering how I can see the query plan without having to
> write things out piece meal.

You could enable logging of plans and timings using some GUC
variables:

<http://www.postgresql.org/docs/8.1/static/runtime-config-statistics.html>
<http://www.postgresql.org/docs/8.1/static/runtime-config-logging.html#RUNTIME-CONFIG-LOGGING-WHAT>

The output is different from explain's, but most of the information
should be there.

regards,
Andreas

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Luis Silva 2005-12-07 15:09:00 trigger function with arguments from a sql command
Previous Message John DeSoi 2005-12-07 13:37:20 Re: Pl/pgsql import