Hi: I have a table that has a primary key which is a string, that I am trying to run pt-online-schema-change. The table also has another integer, a key auto increment field. So the insert into temporary table takes a long time since it’s doing a
INSERT LOW_PRIORITY IGNORE INTO `historic_moogdb`.`_alerts_new.....FROM `historic_moogdb`.`alerts` FORCE INDEX(`PRIMARY`) WHERE ((`signature` >= 'xxxxxxxxxx')) AND ((`signature` <= 'xxxxxxxxxx')) LOCK IN SHARE MODE /*pt-online-schema-change 11650 copy nibble*/
Is there any way to tell pt-online-schema-change to use alert_id as the primary key?
CREATE TABLE `alerts` ( `signature` varbinary(767) NOT NULL DEFAULT '', `alert_id` bigint(20) NOT NULL AUTO_INCREMENT, .<br>.<br>.<br> `first_event_time` bigint(20) NOT NULL,<br>. `state` int(11) NOT NULL, `owner` int(11) NOT NULL, `entropy` double NOT NULL, `custom_info` text, `rc_probability` double DEFAULT NULL, PRIMARY KEY (`signature`), KEY `alert_id` (`alert_id`), KEY `first_event_time` (`first_event_time`,`alert_id`))<br>