pg.ddx.io pgsql-performance@postgresql.org mailing list archive
help / color / mirror / Atom feedprofiling plpgsql functions..
5+ messages / 3 participants
[nested] [flat]
* profiling plpgsql functions..
@ 2003-04-29 11:25 Rajesh Kumar Mallah <mallah@trade-india.com>
0 siblings, 1 reply; 5+ messages in thread
From: Rajesh Kumar Mallah @ 2003-04-29 11:25 UTC (permalink / raw)
To: pgsql-performance
Is printing timeofday() at various points a good idea
of profiling plpgsql functions?
also is anything wrong with following fragment ?
RAISE INFO '' % , message here ... '' , timeofday() ;
regds
mallah.
--
Rajesh Kumar Mallah,
Project Manager (Development)
Infocom Network Limited, New Delhi
phone: +91(11)6152172 (221) (L) ,9811255597 (M)
Visit http://www.trade-india.com ,
India's Leading B2B eMarketplace.
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: profiling plpgsql functions..
@ 2003-04-29 14:27 Tom Lane <tgl@sss.pgh.pa.us>
parent: Rajesh Kumar Mallah <mallah@trade-india.com>
0 siblings, 1 reply; 5+ messages in thread
From: Tom Lane @ 2003-04-29 14:27 UTC (permalink / raw)
To: Rajesh Kumar Mallah <mallah@trade-india.com>; +Cc: 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
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: profiling plpgsql functions..
@ 2003-04-29 15:56 mallah@trade-india.com
parent: Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 5+ messages in thread
From: mallah@trade-india.com @ 2003-04-29 15:56 UTC (permalink / raw)
To: tgl@sss.pgh.pa.us; +Cc: pgsql-performance
Yep timeofday returns text , but is there anything else
that equivalant that can be differenced inside plpgsql
so that i can print the not of secs/millisecs connsumed?
hmm shud i cast timeofday to timestamp and use timestamp
arithmatic ?
regds
mallah.
> 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
-----------------------------------------
Get your free web based email at trade-india.com.
"India's Leading B2B eMarketplace.!"
http://www.trade-india.com/
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: profiling plpgsql functions..
@ 2003-04-29 16:01 Tom Lane <tgl@sss.pgh.pa.us>
parent: mallah@trade-india.com
0 siblings, 1 reply; 5+ messages in thread
From: Tom Lane @ 2003-04-29 16:01 UTC (permalink / raw)
To: mallah@trade-india.com; +Cc: pgsql-performance
<mallah@trade-india.com> writes:
> hmm shud i cast timeofday to timestamp and use timestamp
> arithmatic ?
Yeah. It's only historical accident that it doesn't return timestamp...
(or better use timestamptz)
regards, tom lane
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: profiling plpgsql functions..
@ 2003-05-01 14:59 Rajesh Kumar Mallah <mallah@trade-india.com>
parent: Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 5+ messages in thread
From: Rajesh Kumar Mallah @ 2003-05-01 14:59 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-performance
the profiling was really helpful to track down
an absense of an appropriate index.
believe me or not the overall speed improvement was 50 times :))
from the order of .4 sec to .008 secs per function call
regds
mallah.
On Tuesday 29 Apr 2003 9:31 pm, Tom Lane wrote:
> <mallah@trade-india.com> writes:
> > hmm shud i cast timeofday to timestamp and use timestamp
> > arithmatic ?
>
> Yeah. It's only historical accident that it doesn't return timestamp...
> (or better use timestamptz)
>
> regards, tom lane
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org
--
Rajesh Kumar Mallah,
Project Manager (Development)
Infocom Network Limited, New Delhi
phone: +91(11)6152172 (221) (L) ,9811255597 (M)
Visit http://www.trade-india.com ,
India's Leading B2B eMarketplace.
^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~2003-05-01 14:59 UTC | newest]
Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-04-29 11:25 profiling plpgsql functions.. Rajesh Kumar Mallah <mallah@trade-india.com>
2003-04-29 14:27 ` Tom Lane <tgl@sss.pgh.pa.us>
2003-04-29 15:56 ` mallah@trade-india.com
2003-04-29 16:01 ` Tom Lane <tgl@sss.pgh.pa.us>
2003-05-01 14:59 ` Rajesh Kumar Mallah <mallah@trade-india.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox