How can I view partition details of a table, like how many partition are there in a table and storage size of each partition?
You can use the sys. partitions system catalog view to return partition info for a table and most kinds of views. You can use the sys. dm_db_partition_stats system dynamic management view to return page and row-count information for every partition in the current database.
Using the SHOW TABLE STATUS statement to determine whether a table is partitioned. Querying the INFORMATION_SCHEMA. PARTITIONS table. Using the statement EXPLAIN SELECT to see which partitions are used by a given SELECT .
The sys. partitions catalog view gives a list of all partitions for tables and most indexes. Just JOIN that with sys. tables to get the tables.
I recommend using Table Inspector in MySQL Workbench, it gives you lot of useful information including most data related to table partitions.
The data it displays is from the query:
SELECT * FROM information_schema.partitions WHERE TABLE_SCHEMA='your_database' AND TABLE_NAME = 'your_table' AND PARTITION_NAME IS NOT NULL
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With