mysql - how to count table rows for find tables with records

it’s easy to get the number of records in a sql table with + select count(*) from <table>; +. but it performs differently between the various db’s. there is also the situation where one encounters a database with many tables, and only a few of those tables contain interesting data, or any rows at all.

these are alternate methods of investigating the size of the tables. for the following examples, the database name is _ urls , and the table name is url _.

select
        count(*)
from
        urls.url
;
select
        table_schema,table_name,table_rows
from
        information_schema.tables
where
        table_schema = 'urls'
and
        table_name = 'url'
;
select
        table_schema,table_name,table_rows
from
        information_schema.tables
where
        table_schema = 'urls'
and
        table_name = 'url'
and
        table_rows > 0
;