Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to view information of partitions in a table?

How can I view partition details of a table, like how many partition are there in a table and storage size of each partition?

like image 206
Ben Avatar asked Aug 26 '14 14:08

Ben


People also ask

How can I see the table partition details in SQL Server?

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.

How can I see the table partitions in MySQL?

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 .

How do I get a list of all the partitioned tables in my database?

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.


1 Answers

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

like image 51
Abraham Romero Avatar answered Sep 20 '22 20:09

Abraham Romero