Created
October 25, 2022 16:37
-
-
Save theothermattm/84509cc03d7eacad1b56f4e1b7c21ae0 to your computer and use it in GitHub Desktop.
Identify Sequential Scans in PostGreSQL
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 relname, | |
seq_scan, | |
seq_tup_read, | |
idx_scan, | |
idx_tup_fetch, | |
seq_tup_read / seq_scan | |
FROM pg_stat_user_tables | |
WHERE seq_scan > 0 | |
ORDER BY seq_tup_read DESC; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment