From: Andres Freund <andres@anarazel.de>
To: Han Zhou <zhouhan@gmail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Fwd: [HACKERS] client performance v.s. server statistics
Date: Wed, 15 Feb 2012 12:36:01 +0100
Message-ID: <201202151236.01839.andres@anarazel.de> (raw)
In-Reply-To: <CADtzDCn3eHDFtrMZqQ1ss7vy78P0TqFQtU+JWmqPre8Db=4Kfw@mail.gmail.com>
References: <CADtzDCkR8O5OJ5bsVs8Lmr3yoi=uuA8GbO-QuNDsnrX9--WubA@mail.gmail.com>
<CADtzDCkjzsQjQHnva8SDdL_H4GEURyW1=oYMikY_JrGD3rZ3GQ@mail.gmail.com>
<CADtzDCn3eHDFtrMZqQ1ss7vy78P0TqFQtU+JWmqPre8Db=4Kfw@mail.gmail.com>
On Wednesday, February 15, 2012 12:33:13 PM Han Zhou wrote:
> Hi,
>
> To be more specific, I list my calculation here:
> The timing shown in psql may include: plan + execution + copying to
> result set in backend (does this step exist?) + transferring data to
> client via socket.
Correct.
> Then I want to know what's the time shown in pg_stat_statement and
> EXPLAIN ANALYZE in terms of the above mentioned parts. And why are the
> gap is almost 10 times (100 ms v.s. 1 second)? As a comparison,
> transferring same amount of data with unix domain socket should cost
> only a very small fraction of this (almost negligible), according to
> my other performance tests.
Yea, you proved my quick theory wrong.
> And I don't think the plan time plays an important role here in
> EXPLAIN ANALYZE, because the command itself costs similar time to the
> "Total runtime" as shown in psql (timing on), which means the plan is
> too simple to take any significant part of time in this case.
Sounds like that.
It would be interesting to see the time difference between:
COPY (SELECT * FROM blub) TO '/tmp/somefile';
COPY (SELECT * FROM blub) TO '/tmp/somefile' BINARY;
EXPLAIN ANALYZE SELECT * FROM blub;
Andres
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: andres@anarazel.de, zhouhan@gmail.com
Subject: Re: Fwd: [HACKERS] client performance v.s. server statistics
In-Reply-To: <201202151236.01839.andres@anarazel.de>
* 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