Alex Rivera | Logout

Is it possible to get a history of queries made in postgres

Asked 2009-10-06T03:31:17.007
106

Is it possible to get a history of queries made in postgres? and is it be possible to get the time it took for each query? I'm currently trying to identify slow queries in the application I'm working on.

I'm using Postgres 8.3.5

Edit
Report

1 Answer

4

If you want to identify slow queries, than the method is to use log_min_duration_statement setting (in postgresql.conf or set per-database with ALTER DATABASE SET).

When you logged the data, you can then use grep or some specialized tools - like pgFouine or my own analyzer - which lacks proper docs, but despite this - runs quite well.

answered 2009-10-06T06:35:50.343

Your Answer