I have problem making partition on large table with a few million rows.
CREATE TABLE `searcheg`.`pages` (
`urlId` int(9) NOT NULL AUTO_INCREMENT,
`url` varchar(1024) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`urlhash` binary(16) NOT NULL,<< MD5 unhex.
PRIMARY KEY (`urlId`),
UNIQUE KEY `urlhash` (`urlhash`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
How do I partition this? urlhash
must be unique as I need to insert large number of rows and check for repeats. As partition must include all unique column and cannot be non integer value. One reason for partition is to reduce the .ibd for more manageable size as it grows over 50G and I want to split them.
urlID as primary key is to prevent the row reorder each time insert is made.
urlhash as unique to prevent duplicate entry.
I am looking for some way to split the table without having to drop the primary key.