Re: query total time im milliseconds

Поиск
Список
Период
Сортировка
От Craig Ringer
Тема Re: query total time im milliseconds
Дата
Msg-id 4E1A25BD.2080905@postnewspapers.com.au
обсуждение исходный текст
Ответ на query total time im milliseconds  (Radhya sahal <rad_cs_2006@yahoo.com>)
Список pgsql-performance
On 10/07/2011 9:08 PM, Radhya sahal wrote:
>
> Dear all ,
> could any one help me?
> when i use pgadmin to exceute a query it shows the total time for query ..
> such as
> (select * form table_name.........)query total time is for example 100 ms
> i want to know the command that can retetive the query total time in
> millisecond
> if i connect with postgresql from java using JDBC
> i need the query total time necessary to use it in my project
> i don't want run explian,explain gives estimated i want real total time
> for the query

Record the value of System.currentTimeMillis() or System.nanoTime(). Run
your query. Subtract the recorded value from the current value of
System.currentTimeMillis() or System.nanoTime() to get the execution
time including how long the query took to transfer data from the server
to your client.

I'm not aware of a way to find out how long the query took to execute on
the server - excluding data transfer to the client - without using
EXPLAIN ANALYZE.

--
Craig Ringer

POST Newspapers
276 Onslow Rd, Shenton Park
Ph: 08 9381 3088     Fax: 08 9388 2258
ABN: 50 008 917 717
http://www.postnewspapers.com.au/

В списке pgsql-performance по дате отправления:

Предыдущее
От: Samuel Gendler
Дата:
Сообщение: Re: Statistics and Multi-Column indexes
Следующее
От: Craig Ringer
Дата:
Сообщение: Re: Fw: query total time im milliseconds