Bruce Momjian:Query_id 与 pg_stat_statements
原文英文,约300词,阅读约需1分钟。发表于: 。In 2014, someone in Korea requested that we add a query_id to pg_stat_activity to match the queryid in pg_stat_statements. This would allow administrators to get duration estimates of currently...
介绍Postgres 14的新功能,通过在pg_stat_activity中添加query_id来匹配pg_stat_statements中的queryid,从而获取当前正在运行的查询的持续时间估计。安装pg_stat_statements并运行查询,可以在pg_stat_activity中查找运行的query_id,然后在pg_stat_statements中查找平均执行时间。这种方法可以帮助估计大多数SQL查询的持续时间。