Skip to content

Commit 0ca7eb0

Browse files
klbokenobodyiam
andauthored
optimization apolloconfigdb-v190-v200-after.sql (#4470)
* add tech-support-qq-4.png * Update README.md * Enhance the user experience in the scenario of submitting duplicate keys * Modify the key-value conflict exception prompt, adjust the code style * optimization apolloconfigdb-v190-v200-after.sql Co-authored-by: Jason Song <[email protected]>
1 parent 2d74140 commit 0ca7eb0

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

scripts/sql/delta/v190-v200/apolloconfigdb-v190-v200-after.sql

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717

1818
Use ApolloConfigDB;
1919

20+
-- Begin:Create indexes to solve the problem of updating large tables
21+
ALTER TABLE `Commit` ADD INDEX `idx_IsDeleted_DeletedAt` (`IsDeleted`, `DeletedAt`);
22+
ALTER TABLE `Release` ADD INDEX `idx_IsDeleted_DeletedAt` (`IsDeleted`, `DeletedAt`);
23+
2024
-- the follow DML won't change the `DataChange_LastTime` field
2125
UPDATE `AccessKey` SET `DeletedAt` = -Id, `DataChange_LastTime` = `DataChange_LastTime` WHERE `IsDeleted` = 1 and `DeletedAt` = 0;
2226
UPDATE `App` SET `DeletedAt` = -Id, `DataChange_LastTime` = `DataChange_LastTime` WHERE `IsDeleted` = 1 and `DeletedAt` = 0;
@@ -74,3 +78,7 @@ ALTER TABLE `Release`
7478
ALTER TABLE `ServerConfig`
7579
ADD UNIQUE INDEX `UK_Key_Cluster_DeletedAt` (`Key`,`Cluster`,`DeletedAt`),
7680
DROP INDEX `IX_Key`;
81+
82+
-- End:Delete temporarily created indexes
83+
ALTER TABLE `Commit` DROP INDEX `idx_IsDeleted_DeletedAt`;
84+
ALTER TABLE `Release` DROP INDEX `idx_IsDeleted_DeletedAt`;

0 commit comments

Comments
 (0)