From: Tom Lane <tgl@sss.pgh.pa.us>
To: Bill Moran <wmoran@collaborativefusion.com>
Cc: tarcizioab@c3sl.ufpr.br
Cc: pgsql-performance@postgresql.org
Subject: Re: Difference between "Explain analyze" and "\timing"
Date: Wed, 30 Jul 2008 21:06:38 -0400
Message-ID: <26508.1217466398@sss.pgh.pa.us> (raw)
In-Reply-To: <20080730205922.ba73b732.wmoran@collaborativefusion.com>
References: <50061.201.15.49.76.1217463555.squirrel@webmail.inf.ufpr.br>
<20080730205922.ba73b732.wmoran@collaborativefusion.com>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: tgl@sss.pgh.pa.us, wmoran@collaborativefusion.com, tarcizioab@c3sl.ufpr.br
Subject: Re: Difference between "Explain analyze" and "\timing"
In-Reply-To: <26508.1217466398@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox