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

前端 未结 7 1981
借酒劲吻你
借酒劲吻你 2021-01-30 03:41

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

7条回答
  •  长情又很酷
    2021-01-30 04:35

    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.

提交回复
热议问题