From: | "Sean Davis" <sdavis2(at)mail(dot)nih(dot)gov> |
---|---|
To: | "Hrishikesh Deshmukh" <hdeshmuk(at)gmail(dot)com>, "Richard Huxton" <dev(at)archonet(dot)com> |
Cc: | "Postgresql-General" <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Time Stamp |
Date: | 2005-03-22 00:05:34 |
Message-ID: | 00a101c52e72$de8cb540$1f6df345@WATSON |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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(at)gmail(dot)com>
To: "Richard Huxton" <dev(at)archonet(dot)com>
Cc: "Postgresql-General" <pgsql-general(at)postgresql(dot)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(at)archonet(dot)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(at)postgresql(dot)org)
>
From | Date | Subject | |
---|---|---|---|
Next Message | Glenn Sullivan | 2005-03-22 00:40:31 | Problem connecting to postmaster |
Previous Message | Andrew J. Kopciuch | 2005-03-21 23:47:35 | Re: Tsearch vector not stored by update/set |