Re: Performance analysis of plpgsql code

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: "Karl O(dot) Pinc" <kop(at)meme(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Performance analysis of plpgsql code
Date: 2005-06-28 01:34:19
Message-ID: 20050628013419.GA17407@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches pgsql-performance

On Tue, Jun 28, 2005 at 01:54:08AM +0000, Karl O. Pinc wrote:
> On 06/27/2005 06:33:03 PM, Michael Fuhr wrote:
>
> >See timeofday().
>
> That only gives you the time at the start of the transaction,
> so you get no indication of how long anything in the
> transaction takes.

Did you read the documentation or try it? Perhaps you're thinking
of now(), current_timestamp, and friends, which don't advance during
a transaction; but as the documentation states, "timeofday() returns
the wall-clock time and does advance during transactions."

I just ran tests on versions of PostgreSQL going back to 7.2.8 and
in all of them timeofday() advanced during a transaction. Does it
not work on your system? If not then something's broken -- what
OS and version of PostgreSQL are you using?

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Karl O. Pinc 2005-06-28 01:54:08 Re: Performance analysis of plpgsql code
Previous Message Alvaro Herrera 2005-06-28 01:29:40 Re: [BUGS] BUG #1707: statistics collector starts with stats_start_collector

Browse pgsql-performance by date

  From Date Subject
Next Message Karl O. Pinc 2005-06-28 01:54:08 Re: Performance analysis of plpgsql code
Previous Message Leigh Dyer 2005-06-28 01:24:48 Faster drives for WAL than for data?