Created
July 13, 2022 21:09
-
-
Save GeorgiyDemo/eda1151e057f27139b565d47fd8df0ad to your computer and use it in GitHub Desktop.
Check performance of Postgres DB via pg_stat_statements lib
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT | |
| substring(query, 1, 50) AS short_query, | |
| round(total_exec_time::numeric, 2) AS total_exec_time, | |
| calls, round(mean_exec_time::numeric, 2) AS mean, | |
| round ((100 * total_exec_time / sum(total_exec_time::numeric) OVER ())::numeric, 2) AS percentage_overall | |
| FROM pg_stat_statements | |
| ORDER BY total_exec_time DESC | |
| LIMIT 35; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment