Created
May 7, 2017 01:26
-
-
Save commondatageek/989f5c5a662312389f89d4f0766a93d3 to your computer and use it in GitHub Desktop.
Fast count rows 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
-- from Erwin Brandstetter | |
-- http://stackoverflow.com/a/7945274/852196 | |
SELECT reltuples::bigint AS estimate | |
FROM pg_class | |
WHERE oid = 'myschema.mytable'::regclass; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment