jtuglu1 commented on code in PR #19672:
URL: https://github.com/apache/druid/pull/19672#discussion_r3572576138
##########
server/src/main/java/org/apache/druid/metadata/SQLMetadataConnector.java:
##########
@@ -663,6 +669,16 @@ protected void alterSegmentTable()
"IDX_%S_DATASOURCE_UPGRADED_FROM_SEGMENT_ID",
List.of("dataSource", "upgraded_from_segment_id")
);
+ // Migration for existing tables: covering index backing the used-segment
ID
+ // scan on every cache sync (see createSegmentTable).
+ createIndex(
+ tableName,
+ "IDX_%S_USED_USLU_DATASOURCE",
+ List.of("used", "used_status_last_updated", "dataSource", "id")
+ );
+ // The covering index above leads with 'used', so it supersedes the
single-column
+ // IDX_%S_USED. Drop the now-redundant index on existing tables.
+ dropIndex(tableName, "IDX_%S_USED", List.of("used"));
Review Comment:
+1 to the above. I'd rather put in a separate change since it makes sense
for that to be a sweeping change across all index creation attempts
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]