Re: libpq or postgresql performance

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.


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


[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux