Partition With out use Primary Key
His people
To try solve my last post, im add a column to a table and use how field in Linear Hash, but mysql give me a error because this field not is primary key.
DROP TABLE IF EXISTS `Sid`;
CREATE TABLE `Sid` (
`sid_id` int(11) NOT NULL auto_increment,
`sid` varchar(255) NOT NULL default '',
`keyword_id` int(11) NOT NULL default '0',
`creative_id` int(11) NOT NULL default '0',
`sid2` varchar(255) NOT NULL default '',
`max_bid_cpc` double(5,2) unsigned NOT NULL default '0.00',
`min_cpc` double(5,2) unsigned NOT NULL default '0.00',
`parent_id` int(11) NOT NULL default '0',
`bid_percentage` double(5,2) NOT NULL default '1.00',
`status` varchar(50) NOT NULL default 'active',
`client_id` int(11) NOT NULL default '0',
PRIMARY KEY (`sid_id`),
KEY `keyword_id` (`keyword_id`),
KEY `creative_id` (`creative_id`),
KEY `sid2` (`sid2`),
KEY `sid` (`sid`),
KEY `parent_id` (`parent_id`)
)
PARTITION BY LINEAR HASH(`client_id`)
PARTITIONS 50;
--- Error ---
ERROR 1490 (HY000): A PRIMARY KEY need to include all fields in the partition function
Some idea how solve this.
enzo