Created
April 21, 2020 15:59
-
-
Save aks/d25018332da3ebf7b8336d0fa962e830 to your computer and use it in GitHub Desktop.
Fast query for table size
This file contains 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
-- query a large table for its size without doing a full-table scan | |
-- replace the table name as needed | |
SELECT to_char(reltuples::bigint,'999,999,999,999') AS estimate | |
FROM pg_class | |
WHERE relname='BIG_TABLE'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment