Re: Difference between "Explain analyze" and "\timing"

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Difference between "Explain analyze" and "\timing"
Дата
Msg-id 26508.1217466398@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Difference between "Explain analyze" and "\timing"  (Bill Moran <wmoran@collaborativefusion.com>)
Список pgsql-performance
Bill Moran <wmoran@collaborativefusion.com> writes:
> tarcizioab@c3sl.ufpr.br wrote:
>> The commands "\timing" and "EXPLAIN ANALYZE" return values related to the
>> time of execution of the instruction. These values are "Time:" and "Total
>> runtime:" respectively. What is the difference between these values, and
>> the specific use of each command in queries?

> The time reported by explain will be the time it took the server to
> execute the query.

> The time reported by \timing is the time it takes the client (psql) to
> get the result.  This will be the time the server took, plus any network
> delays and time required to process the query and result on the client
> side.

Also realize that explain analyze only reports the time to *execute*
the query.  Not counted are the time to parse and plan the query
beforehand and prepare the explain output afterwards.  But psql's number
is the whole round-trip time and so includes all that stuff.

If any of this seems confusing, you might find it worth reading
this overview of the Postgres system structure:
http://www.postgresql.org/docs/8.3/static/overview.html

            regards, tom lane

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

Предыдущее
От: Bill Moran
Дата:
Сообщение: Re: Difference between "Explain analyze" and "\timing"
Следующее
От: Miernik
Дата:
Сообщение: why "WHERE uid NOT IN" is so slow, and EXCEPT in the same situtation is fast?