vishesh92 commented on code in PR #11443:
URL: https://github.com/apache/cloudstack/pull/11443#discussion_r4409238986
##########
engine/schema/src/main/java/com/cloud/upgrade/dao/Upgrade42300to2400.java:
##########
@@ -27,4 +29,25 @@ public String[] getUpgradableVersionRange() {
public String getUpgradedVersion() {
return "24.0.0";
}
+
+ @Override
+ public void performDataMigration(Connection conn) {
+ addIndexes(conn);
+ dropOldIndexes(conn);
+ }
+
+ private void addIndexes(Connection conn) {
+ DbUpgradeUtils.addIndexWithNameIfNeeded(conn, "event",
"i_event__archived__created__id",
+ "archived", "created", "id");
+ DbUpgradeUtils.addIndexWithNameIfNeeded(conn, "event",
"i_event__account_id__archived__created__id",
+ "account_id", "archived", "created", "id");
+ DbUpgradeUtils.addIndexWithNameIfNeeded(conn, "event",
"i_event__domain_id__archived__created__id",
+ "domain_id", "archived", "created", "id");
+ DbUpgradeUtils.addIndexWithNameIfNeeded(conn, "event",
"i_event__resource_type__resource_id__archived__created__id",
+ "resource_type", "resource_id", "archived", "created", "id");
+ }
+
+ private void dropOldIndexes(Connection conn) {
Review Comment:
we should also drop `archived` & `i_event__account_id` indexes. Since we are
creating composite indexes starting with the same columns.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]