Thread: can I show number of records returned by a query in a log?
Hello, I'm trying to capture amount of data moving from client app to the server & back. The client is executable (c#) gue on windows, server is lunix centOS, PostgreSQL 8.4. We see serious performance difference between execution via LAN & VPN. I enabled the logging and used pgFouine to analyzed the logs and it looks very strange - 2000-3000 queries in 10 min. In one case I see the client (user is the client dbuser) query "select * from vw_abc" sent 10 times in 1 sec ( timestamp is the same), is it realy 10 times or it was logged 10 times ? I see 900 queries sent by 1 client in 7 min with 1 click on the screen - does the log show the real thing? Is it possible to log the number of records returned by that query? thank you. Helen -- View this message in context: http://postgresql.1045698.n5.nabble.com/can-I-show-number-of-records-returned-by-a-query-in-a-log-tp4999630p4999630.html Sent from the PostgreSQL - general mailing list archive at Nabble.com.
On November 16, 2011 05:07:05 PM hyelluas wrote: > I see 900 queries sent by 1 client in 7 min with 1 click on the screen - > does the log show the real thing? The logs show the real thing. Gotta love ORMs. > > > Is it possible to log the number of records returned by that query? I doubt the record count or data volume is the problem. It's more likely the latency cost of sending 900 queries one at a time and waiting for the replies at VPN latencies. I don't know how to log the result record count, though, maybe someone else does.
On 17 Listopad 2011, 2:07, hyelluas wrote: > Hello, > > I'm trying to capture amount of data moving from client app to the server > & > back. > The client is executable (c#) gue on windows, server is lunix centOS, > PostgreSQL 8.4. > We see serious performance difference between execution via LAN & VPN. The VPN usually suck when it comes to a performance. Do some basic testing at the network level - ping with/without VPN, throughput and you'll see the difference. This is not a problem of the database, it's the environment. > I enabled the logging and used pgFouine to analyzed the logs and it > looks > very strange - 2000-3000 queries in 10 min. > > In one case I see the client (user is the client dbuser) query "select * > from vw_abc" sent 10 times in 1 sec ( timestamp is the same), is it realy > 10 times or it was logged 10 times ? > > I see 900 queries sent by 1 client in 7 min with 1 click on the screen - > does the log show the real thing? Yes, the log shows the real thing. Have you checked the log directly or just the output of pgfounie? Theoretically there could be a bug in pgfounie, repeating some of the queries, but I consider that highly unlikely. > Is it possible to log the number of records returned by that query? Currently there's no such option. But it's possible to write a simple extension that would do that - actually pg_stat_statements does that. Tomas
Thank you all, I did look at the log , I enabled pg_stat_statements , however it showed the buffers, scans and other info about the query execution - not the records number, any idea how can I get it? I agree that the problem is in qty of the queries, will investigate the client. thank you. Helen -- View this message in context: http://postgresql.1045698.n5.nabble.com/can-I-show-number-of-records-returned-by-a-query-in-a-log-tp4999630p4999782.html Sent from the PostgreSQL - general mailing list archive at Nabble.com.