Re: Determine query run-time from pg_* tables

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Ow Mun Heng <Ow(dot)Mun(dot)Heng(at)wdc(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Determine query run-time from pg_* tables
Date: 2007-10-23 13:43:56
Message-ID: 20071023134356.GJ5772@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Ow Mun Heng wrote:
> Hi,
>
> Is there a method to obtain the query's runtime from any of the pg_*
> tables?

No. You can use log_durations and log_statement for that. We don't
store that info in tables.

> Right now, I'm only seeing the backend_start_time (from
> pg_stat_activity) (and I'm also not sure how to interpret this.

This is the time that the session was started. Nothing to do with the
query itself.

--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alvaro Herrera 2007-10-23 13:49:41 Re: autovacuum and locks
Previous Message Alvaro Herrera 2007-10-23 12:54:57 Re: Bitmap Heap scan 8.1/8.2