hummingBird
hummingBird

Reputation: 2555

MySQL Partition usage stats

I applied partitioning to my tables today, and would now like to see stats for each partition (how many rows per partition).

Now, I partitioned it by date, so it's quite easy to get it via "SELECT COUNT(*) FROM table WHERE date >= ... AND date <= ..."... However, what happens when you break your tables by i.e. KEY?

I checked MySQL online manual, but they only use solutions similar to one I explained above. There's gotta be a simpler method (or more fancy looking, so to speak).

Cheers

Upvotes: 2

Views: 752

Answers (1)

Johan
Johan

Reputation: 76670

Put EXPLAIN PARTITIONS in front of your select:

EXPLAIN PARTITIONS SELECT ... FROM table ....

For more info see:
http://dev.mysql.com/doc/refman/5.1/en/partitioning-info.html

Upvotes: 2

Related Questions