MySQL: How to find out table stats like rows, space used and last update time

The following MySQL command provides a lot of good information about tables.

show table status 

This statement also displays information about views.

SHOW TABLE STATUS returns the following important fields along with a lot of other intersting data:

Engine
The storage engine for the table. See Chapter 13, Storage Engines.

Rows
The number of rows. Some storage engines, such as MyISAM, store the exact count. For other storage engines, such as InnoDB, this value is an approximation, and may vary from the actual value by as much as 40 to 50%. In such cases, use SELECT COUNT(*) to obtain an accurate count.

Avg_row_length
The average row length.

Data_length
The length of the data file.

More info here

Advertisements

3 thoughts on “MySQL: How to find out table stats like rows, space used and last update time

  1. It’s perfect time to make a few plans for the future and it is time to be happy.
    I’ve learn this publish and if I may just I wish to counsel you
    some attention-grabbing issues or tips. Perhaps you could write
    next articles regarding this article. I want to read even more things approximately it!

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s