Обсуждение: pg_stat_statements opening claim is potentially misleading
The following documentation comment has been logged on the website: Page: https://www.postgresql.org/docs/10/static/pgstatstatements.html Description: At the top of the pg_stat_statements docs page[1] it states: "The pg_stat_statements module provides a means for tracking execution statistics of all SQL statements executed by a server." This is not strictly true. In cases where large numbers of queries are cancelled, such as by `statement_timeout` on a loaded server, they are not in fact recorded by pg_stat_statements. This has been brought up on the mailing list [2] and has been stated as the intended behavior. This can be surprising particularly if cancelled queries account for a large amount of server execution time in pathological cases. Perhaps a simple change such as this would help clarify this: "The pg_stat_statements module provides a means for tracking execution statistics of all SQL statements successfully executed by a server." Or an explicit callout that cancelled queries do not count regardless of how much execution time they actually use. -Casey [1] https://www.postgresql.org/docs/10/static/pgstatstatements.html [2] https://www.postgresql.org/message-id/20171112222811.1464.28388%40wrigleys.postgresql.org
The same should be noted for auto_explain as described here www.postgresql-archive.org/Statements-that-time-out-are-not-considered-here-td6006753.html As you, I was quite confused that cancelled queries where not taken into account, I first consider total_time, and mean_time in a second step (so durations of timeout statements doesn't seem a problem here to me). Here is an other discussion that could be interesting: www.postgresql-archive.org/pg-stat-statements-how-to-catch-non-successfully-finished-statements-td6018801.html Regards PAscal -- Sent from: http://www.postgresql-archive.org/PostgreSQL-docs-f2165602.html