You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by "JoaoJandre (via GitHub)" <gi...@apache.org> on 2026/06/03 18:11:20 UTC
Re: [PR] Events listing, deletion and archival optimizations [cloudstack]
JoaoJandre commented on code in PR #11443:
URL: https://github.com/apache/cloudstack/pull/11443#discussion_r3350468818
##########
engine/schema/src/main/java/com/cloud/upgrade/dao/Upgrade42210to42300.java:
##########
@@ -89,4 +90,10 @@ protected void updateJsInterpretationEnabledFields(Connection conn, String encry
logger.warn("Error while decrypting configuration 'js.interpretation.enabled'. The configuration may already be decrypted.");
}
}
+
+ private void addIndexes(Connection conn) {
+ DbUpgradeUtils.addIndexWithNameIfNeeded(conn, "event", "i_event__multiple_columns_for_generic_search",
+ "account_id", "domain_id", "archived", "display", "resource_type", "resource_id", "start_id", "type", "level",
+ "created", "id");
Review Comment:
I'm not sure that the order of the indexes here is the best. Shouldn't every record with a given account_id have the same domain_id? If so, I think we should flip the order of those. Also, I think that the archived column might be the best one to be the first in the index, as it is probably the most selective.
Also, do we need the index to cover all these columns? Did you test the data recovery with fewer columns? How does this index compare to an index with fewer columns in terms of performance of insertions and deletions?
--
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: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org