Can I log query execution time in PostgreSQL 8.4?

前端 未结 3 1487
刺人心
刺人心 2020-12-31 08:32

I want to log each query execution time which is run in a day.

For example like this,

2012-10-01 13:23:38 STATEMENT: SELECT * FROM pg_stat_database           


        
3条回答
  •  有刺的猬
    2020-12-31 09:04

    I think a better option is to enable pg_stat_statements by enabling the PG stats extension. This will help you to find the query execution time for each query nicely recorded in a view

提交回复
热议问题