Reputation: 57176
Why does INFORMATION_SCHEMA.TABLES take ages to return result on my live server but not on my localhost? (I think it clashes my live server each time I perform this!)
Any alternatives for INFORMATION_SCHEMA.TABLES to list all tables and numbers of record in each table?
Here is the query:
SELECT *
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_SCHEMA LIKE 'db_name'
What I need are only
<?php echo $item['TABLE_NAME'];?> (using INFORMATION_SCHEMA.TABLES)
<?php echo $item['TABLE_ROWS'];?> (using INFORMATION_SCHEMA.TABLES)
Thanks.
Upvotes: 0
Views: 2966
Reputation: 3047
Show Tables
. Although doubtful this will be much faster than an information_schema query. Unless your network connection is dreadfully slow
SELECT TABLE_NAME, TABLE_ROWS
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_SCHEMA LIKE 'db_name'
Upvotes: 1