I have a partition table on basis of Primary key having 1.5 Billion rows in it. But when i check ibd files only 80 ibd show in GB's whereas 120ibd shows 1MB file. I would like to know how does the distribution work when i limit Partition with PARTITIONS 200. My structure is as below. Given that id & checksum both are unique all the time.
CREATE TABLE `mapping` (
`id` varchar(50) NOT NULL DEFAULT '',
`sha_checksum` varchar(50) NOT NULL DEFAULT '',
`path_id` varchar(90) DEFAULT NULL,
`file_id` varchar(35) DEFAULT NULL,
`server_id` CHAR(6) DEFAULT NULL,
PRIMARY KEY (`id`,`sha_checksum`)
) ENGINE=InnoDB
/*!50100 PARTITION BY KEY (id,sha_checksum)
PARTITIONS 200 */
Please help me to understand where im wrong.
SELECT partition_name, table_rows FROM INFORMATION_SCHEMA.PARTITIONS WHERE table_name='mapping';
may help you understand the row distribution among partitions. – jynus Feb 9 at 13:48