Mutiple queryies will eventually loose out to Single query because of default resource allocation , connectionsset , concurrent network traffic
As data grows, even smaller queries will show signs of aging.
The best method is to use indexes and set query definition to take optimum use of those indexes.
anyway pls. post example query for more infor
(use Logs to check for better results)
>> Pg_log
Logs are stored in Installationfolder/data/pg_log folder. While log settings are placed in postgresql.conf file.
Log format is usually set as stderr. But CSV log format is recommended. In order to enable CSV format change in
- log_destination = 'stderr,csvlog'
- logging_collector = on
In order to log all queries, very usefull for new installations, set min. execution time of a query that will be logged
- log_min_duration_statement = 0
In order to view active Queries on your database, use
- SELECT * FROM pg_stat_activity
To log specific queries set query type
- log_statement = 'all' # none, ddl, mod, all