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 -- Sent via pgsql-performance mailing list (pgsql-performance@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance