Re: How to get the used time when operate a select query?

From: nconway(at)klamath(dot)dyndns(dot)org (Neil Conway)
To: Oskar Berggren <beo(at)sgs(dot)o(dot)se>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: How to get the used time when operate a select query?
Date: 2002-06-27 14:03:16
Message-ID: 20020627140316.GB26194@klamath.dyndns.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Jun 27, 2002 at 12:01:09PM +0200, Oskar Berggren wrote:
> $B2+=ULP wrote:
> >How can I get the time which a select query use?
> >thank you!
>
> If you are using version 7.2 or later, try the command
>
> EXPLAIN ANALYZE <any query>
>
> This will perform the query (even if it is a DELETE FROM <table>!)
> and show the actual time.

BTW in 7.3, you'll be able to do "\timing" inside psql to enable
client-side timing. i.e.

nconway=# \timing
Timing is on.
nconway=# select 1;
?column?
----------
1
(1 row)

Total time: 0.001s
nconway=#

Cheers,

Neil

--
Neil Conway <neilconway(at)rogers(dot)com>
PGP Key ID: DB3C29FC

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jeff Eckermann 2002-06-27 14:08:09 Re:
Previous Message Curt Sampson 2002-06-27 14:02:57 Re: Still problems with memory swapping and server load