From: | Ireneusz Pluta <ipluta(at)wp(dot)pl> |
---|---|
To: | Aryan Ariel Rodriguez Chalas <wimogan(at)yahoo(dot)com> |
Cc: | "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org> |
Subject: | Re: libpq or postgresql performance |
Date: | 2012-09-07 06:52:24 |
Message-ID: | 504999A8.1010301@wp.pl |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-performance |
W dniu 2012-09-06 22:04, Aryan Ariel Rodriguez Chalas pisze:
> -Why if I connect to the remote server desktop (using RDP or any Remote Desktop Application) and run the application using the same internet connection, it runs really fast when making requests to postgresql; but if I run the application locally by connecting to the remote postgresql server through "libpq", it's really slow?.
It might look like the client side fetches too much data or sends too many queries over the
connection to the database server and then further processes that data locally. Are you using some
kind of ORM in your application?
If that is the case, you might need to refactor your application to do as much as possible
computation at server side and deal only with computation results over the connection, not the raw data.
Try to see in server log what SQL statements are executed while you are running your application.
You need to SET log_statement TO 'all' for that.
With psql, try to see how much data (how many rows) are returned from that query you call "simple
query". Even simple query may return a lot of rows. Server backend might execute it quickly, but
returning a huge result over the Internet might take a long time.
From | Date | Subject | |
---|---|---|---|
Next Message | John Nash | 2012-09-07 10:55:59 | Re: exponential performance decrease in ISD transaction |
Previous Message | Albe Laurenz | 2012-09-07 06:45:38 | Re: libpq or postgresql performance |