fix: table index optimize

This commit is contained in:
2024-01-31 16:06:27 +08:00
parent c560541a21
commit de2ca4cfd3
6 changed files with 143 additions and 207 deletions

View File

@@ -153,4 +153,20 @@ ADD PRIMARY KEY (`id`) USING BTREE;
ALTER TABLE `omc_db`.`gold_kpi`
ADD INDEX IF NOT EXISTS `idx_kpiid` (`kpi_id`) USING BTREE,
ADD INDEX IF NOT EXISTS `idx_timestamp` (`timestamp`) USING BTREE;
ADD INDEX IF NOT EXISTS `idx_timestamp` (`timestamp`) USING BTREE;
ALTER TABLE `omc_db`.`gold_kpi`
DROP INDEX `idx_st_nt_id`,
ADD INDEX IF NOT EXISTS `idx_nt_id` (`ne_type`, `rm_uid`) USING BTREE;
ALTER TABLE `omc_db`.`gold_kpi`
ADD INDEX IF NOT EXISTS `idx_date` (`date`) USING BTREE;
ALTER TABLE `omc_db`.`gold_kpi`
ADD UNIQUE INDEX IF NOT EXISTS `idx_pk_id` (`id`) USING BTREE;
ALTER TABLE `omc_db`.`kpi_title`
ADD INDEX IF NOT EXISTS `idx_kpi_id` (`kpi_id`) USING BTREE;
ALTER TABLE `omc_db`.`alarm`
ADD UNIQUE INDEX IF NOT EXISTS `idx_pk_id` (`id`) USING BTREE;