Back to Yugabyte Db

pg_stat_statements extension

docs/content/v2024.1/additional-features/pg-extensions/extension-pgstatstatements.md

2026.1.0.0-b25754 B
Original Source

The pg_stat_statements module provides a means for tracking execution statistics of all SQL statements executed by a server.

sql
CREATE EXTENSION pg_stat_statements;

SELECT query, calls, total_time, min_time, max_time, mean_time, stddev_time, rows FROM pg_stat_statements;

To get the output of pg_stat_statements in JSON format, visit https://<yb-tserver-ip>:13000/statements in your web browser, where <yb-tserver-ip> is the IP address of any YB-TServer node in your cluster.

For more information on using pg_stat_statements in YugabyteDB, refer to Get query statistics using pg_stat_statements.