简体   繁体   中英

Query execution time log, PostgreSQL?

Objective: I have thousands of data, I want to know how to have a record of all the queries and the time it takes to complete each query.

Any suggestions what I should investigate? I've seen about pg_stat_activity. I am fully available to nurture myself, I would appreciate any documentation, since I only have basic knowledge.

PD: Thanks.

There is a log_min_duration_statement setting in the postgresql.conf file that defines a minimum duration, after which the duration and statement will be logged. If set to zero, all statements and durations are logged.

One should take care that using this setting does not consume too much disk space.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM