Re: TIMING A QUERY ???

Поиск
Список
Период
Сортировка
От Gregory Stark
Тема Re: TIMING A QUERY ???
Дата
Msg-id 87bqeiapk2.fsf@oxford.xeocode.com
обсуждение исходный текст
Ответ на Re: TIMING A QUERY ???  (Andrew Sullivan <ajs@crankycanuck.ca>)
Ответы Re: TIMING A QUERY ???  (smiley2211 <smiley2211@yahoo.com>)
Список pgsql-performance
"Andrew Sullivan" <ajs@crankycanuck.ca> writes:

> On Wed, Jul 11, 2007 at 08:21:40AM -0700, smiley2211 wrote:
>>
>> How can I get the time it takes a query to execute - explain analyze is
>> taking over 5 hours to complete
>
> You can't get it any faster than what explain analyse does: it runs
> the query.  How else would you get the answer?

explain analyze does actually run slower than the actual query because it has
to check the time before and after each step of the query, potentially
thousands of times. If it's a disk-bound query that doesn't matter much but if
it's a cpu-bound query it can.

>> ...can I use \timing???  I don't get any time when using the
>> \timing option...

Yes you can use \timing. You'll have to provide more information of what
you're doing before anyone can help you.

--
  Gregory Stark
  EnterpriseDB          http://www.enterprisedb.com


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: TIMING A QUERY ???
Следующее
От: "Jignesh K. Shah"
Дата:
Сообщение: Re: PostgreSQL publishes first real benchmark