Re: Time Stamp - Mailing list pgsql-general

From Sean Davis
Subject Re: Time Stamp
Date
Msg-id 00a101c52e72$de8cb540$1f6df345@WATSON
Whole thread Raw
In response to Time Stamp  (Hrishikesh Deshmukh <hdeshmuk@gmail.com>)
List pgsql-general
Hrishi,

Depending on what you are using the information for, you might want to think
about using EXPLAIN ANALYZE like:

EXPLAIN ANALYZE SELECT * FROM TEST_TABLE;

This will give you the output of the explain command (describing what the
query planner decided was the best plan) and the results of various timing
results.  It doesn't include the "Total" time, but it is pretty close.  If I
recall, you were interested in doing this from within R (from post in
another group).  In that specific situation, you can use R's timing
commands.  From within R, type:

 help.search('timing')
or
help.search('profile')

In general, though, it is probably most useful to get the timings for
queries from explain analyze, as it gives you a wealth of information that
you can then use to optimize the results.

Sean

----- Original Message -----
From: "Hrishikesh Deshmukh" <hdeshmuk@gmail.com>
To: "Richard Huxton" <dev@archonet.com>
Cc: "Postgresql-General" <pgsql-general@postgresql.org>
Sent: Monday, March 21, 2005 11:38 AM
Subject: Re: [GENERAL] Time Stamp


> Hi,
>
> I want to know how long did it take for my query to run!
>
> Thanks,
> Hrishi
>
>
> On Mon, 21 Mar 2005 15:57:38 +0000, Richard Huxton <dev@archonet.com>
> wrote:
>> Hrishikesh Deshmukh wrote:
>> > Hi All,
>> >
>> > I want to get a "timestamp" of the queries that i run!
>> > Is there a builtin command to do this/ does one need to write a
>> > function/stored procedure!
>> > Any pointers will help.
>>
>> You don't say where you want this "timestamp".
>>
>> In psql look into "\timing" (see the man page)
>> To record this in the logs, see the configuration section of the manual,
>> specifically "Error Reporting and Logging"
>>
>> --
>>    Richard Huxton
>>    Archonet Ltd
>>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>    (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
>



pgsql-general by date:

Previous
From: "Andrew J. Kopciuch"
Date:
Subject: Re: Tsearch vector not stored by update/set
Next
From: Glenn Sullivan
Date:
Subject: Problem connecting to postmaster