[Bugfix]删除idx_cluster_phy_id 索引并新增idx_cluster_update_time索引(#918)

This commit is contained in:
shizeying
2023-02-15 17:39:54 +08:00
committed by EricZeng
parent eed9571ffa
commit 03f81bc6de
2 changed files with 7 additions and 2 deletions

View File

@@ -56,6 +56,11 @@ CREATE TABLE `ks_ha_active_standby_relation` (
UNIQUE KEY `uniq_cluster_res` (`res_type`,`active_cluster_phy_id`,`standby_cluster_phy_id`,`res_name`),
UNIQUE KEY `uniq_res_type_standby_cluster_res_name` (`res_type`,`standby_cluster_phy_id`,`res_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='HA主备关系表';
-- 删除idx_cluster_phy_id 索引并新增idx_cluster_update_time索引
ALTER TABLE `ks_km_kafka_change_record` DROP INDEX `idx_cluster_phy_id` ,
ADD INDEX `idx_cluster_update_time` (`cluster_phy_id` ASC, `update_time` ASC);
```
### 升级至 `3.2.0` 版本

View File

@@ -196,7 +196,7 @@ CREATE TABLE `ks_km_kafka_change_record` (
`update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
PRIMARY KEY (`id`),
UNIQUE KEY `unique_field` (`unique_field`),
KEY `idx_cluster_phy_id` (`cluster_phy_id`)
KEY `idx_cluster_update_time` (`cluster_phy_id` ASC, `update_time` ASC)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Kafka变更记录表';
@@ -480,4 +480,4 @@ CREATE TABLE `ks_ha_active_standby_relation` (
PRIMARY KEY (`id`),
UNIQUE KEY `uniq_cluster_res` (`res_type`,`active_cluster_phy_id`,`standby_cluster_phy_id`,`res_name`),
UNIQUE KEY `uniq_res_type_standby_cluster_res_name` (`res_type`,`standby_cluster_phy_id`,`res_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='HA主备关系表';
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='HA主备关系表';