Re: [PERFORM] Copy command Faster than original select

2015-02-08 Thread Belal Al-Hamed
Executing Select count(a.*) from (select ... from mytable join .. join ...
order by ) as a; 

Total query runtime: 454 ms.
1 row retrieved.





--
View this message in context: 
http://postgresql.nabble.com/Copy-command-Faster-than-original-select-tp5836886p5837105.html
Sent from the PostgreSQL - performance mailing list archive at Nabble.com.


-- 
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance


Re: [PERFORM] Copy command Faster than original select

2015-02-06 Thread Belal Al-Hamed
this slowdown can be enforced by slow client (or slow network).
As I said i made the tow test on the same machine as the server using
PGAdmin no network involved.

pgAdmin is not terrible fast
I also try the same query from my application using libpq I get same results

regards



--
View this message in context: 
http://postgresql.nabble.com/Copy-command-Faster-than-original-select-tp5836886p5836893.html
Sent from the PostgreSQL - performance mailing list archive at Nabble.com.


-- 
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance


Re: [PERFORM] Copy command Faster than original select

2015-02-06 Thread Belal Al-Hamed
fast as

Query returned successfully: 43602 rows affected, 1089 ms execution time.



--
View this message in context: 
http://postgresql.nabble.com/Copy-command-Faster-than-original-select-tp5836886p5836902.html
Sent from the PostgreSQL - performance mailing list archive at Nabble.com.


-- 
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance


Re: [PERFORM] Copy command Faster than original select

2015-02-06 Thread Belal Al-Hamed
Let me change my question to this perhaps it would be clearer

why writing data result of select statment from PG server to file on disk
using copy statement is much faster than getting same data through PGAdmin
via libpg on the same PC on the same system on the same connection
(localhost) ?



--
View this message in context: 
http://postgresql.nabble.com/Copy-command-Faster-than-original-select-tp5836886p5836933.html
Sent from the PostgreSQL - performance mailing list archive at Nabble.com.


-- 
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance


Re: [PERFORM] Copy command Faster than original select

2015-02-06 Thread Belal Al-Hamed
so bottle neck have to be some where between client and server
that's  what I need to know !
where is the bug to made this performance

Can you try again but with EXPLAIN *ANALYZE* (not only EXPLAIN)?
it's not a matter of plan problem  I think, it's related to sending data
from server to client, perhaps in allocating buffers for data or problem in
libpq I don't know ...
because why it's super fast exporting same select to file using copy
command.
again I am using the same pc of the postgresql server

regards to all



--
View this message in context: 
http://postgresql.nabble.com/Copy-command-Faster-than-original-select-tp5836886p5836917.html
Sent from the PostgreSQL - performance mailing list archive at Nabble.com.


-- 
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance