Re: profiling plpgsql functions.. - Mailing list pgsql-performance

From Tom Lane
Subject Re: profiling plpgsql functions..
Date
Msg-id 26413.1051626475@sss.pgh.pa.us
Whole thread Raw
In response to profiling plpgsql functions..  (Rajesh Kumar Mallah <mallah@trade-india.com>)
Responses Re: profiling plpgsql functions..
List pgsql-performance
Rajesh Kumar Mallah <mallah@trade-india.com> writes:
> Is printing timeofday() at various points a good idea
> of profiling plpgsql functions?

Sure.

> also is anything wrong with following fragment ?
> RAISE INFO '' % , message here ... '' , timeofday() ;

IIRC, RAISE is pretty slovenly implemented :-( ... it will only take
plain variable references as additional arguments.  So you'll have to
do

        var := timeofday();
        RAISE INFO ''... '', var;

I believe timeofday() produces TEXT, so declare the var that way.

            regards, tom lane


pgsql-performance by date:

Previous
From: Tom Lane
Date:
Subject: Re: Optimizer not using index when it should
Next
From: Tom Lane
Date:
Subject: Re: Query Plan far worse in 7.3.2 than 7.2.1