I've a table which is getting slower when writing or reading by the unique key. Will partitioning solve this problem?
CREATE TABLE `path` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`protocol` tinyint(3) unsigned NOT NULL,
`path` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `protocol` (`protocol`,`path`)
) ENGINE=MyISAM AUTO_INCREMENT=109781814 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
When I try to partition it, I get:
mysql> alter table path PARTITION by hash( id + protocol + path ) partitions 10 ;
ERROR 1491 (HY000): The PARTITION function returns the wrong type
What's the correct way to partition such a table?
Thanks,
Klaus