Querying the INFORMATION_SCHEMA.PARTITIONS table

Compared to all the preceding methods, INFORMATION_SCHEMA.PARTITIONS gives more information about the partitions:

mysql> SHOW CREATE TABLE INFORMATION_SCHEMA.PARTITIONS\G*************************** 1. row ***************************       Table: PARTITIONSCreate Table: CREATE TEMPORARY TABLE `PARTITIONS` (  `TABLE_CATALOG` varchar(512) NOT NULL DEFAULT '',  `TABLE_SCHEMA` varchar(64) NOT NULL DEFAULT '',  `TABLE_NAME` varchar(64) NOT NULL DEFAULT '',  `PARTITION_NAME` varchar(64) DEFAULT NULL,  `SUBPARTITION_NAME` varchar(64) DEFAULT NULL,  `PARTITION_ORDINAL_POSITION` bigint(21) unsigned DEFAULT NULL,  `SUBPARTITION_ORDINAL_POSITION` bigint(21) unsigned DEFAULT NULL, `PARTITION_METHOD` varchar(18) DEFAULT ...

Get MySQL 8 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.