Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • 3
    Thanks, I was hoping I wouldn't have to install any plugins/gems to get exact counts. Commented Sep 2, 2014 at 20:02
  • 1
    Takes too long to execute in case of large number of tables in the database. Commented May 15, 2018 at 7:13
  • 2
    add "select * from (" at beginning and ") as output order by exact_row_count desc" at the end of generated query after removing last UNION to get order by table count desc Commented Jun 22, 2018 at 5:42
  • 3
    To exclude views: WHERE table_schema = 'my_schema' and TABLE_TYPE LIKE '%TABLE%' Commented Jul 27, 2019 at 0:42
  • 3
    This is THE real answer for me. Commented Jul 18, 2020 at 13:48