Re: Fwd: [HACKERS] client performance v.s. server statistics - Mailing list pgsql-performance

From Andres Freund
Subject Re: Fwd: [HACKERS] client performance v.s. server statistics
Date
Msg-id 201202151236.01839.andres@anarazel.de
Whole thread Raw
In response to Re: Fwd: [HACKERS] client performance v.s. server statistics  (Han Zhou <zhouhan@gmail.com>)
Responses Re: Fwd: [HACKERS] client performance v.s. server statistics  (Han Zhou <zhouhan@gmail.com>)
List pgsql-performance
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

pgsql-performance by date:

Previous
From: Han Zhou
Date:
Subject: Re: Fwd: [HACKERS] client performance v.s. server statistics
Next
From: Gabriel Biberian
Date:
Subject: UPDATE on NOT JOIN