From 60a3a802b6a4fdda243ec27f1ccfa26d29f5cb79 Mon Sep 17 00:00:00 2001 From: lokesh-lingarajan Date: Thu, 16 Dec 2021 10:28:20 -0800 Subject: [PATCH] Modifying index from druid_segments(datasource, used, end) to druid_segments(datasource, used, end, start) to support kill task (#11894) This index helps in faster query results during kill task's query on interval based unused segment listing. This can become a bottleneck in some production loads causing coordinator to wait longer for metadata db replies and impacting Kafka ingestion. The modified index has helped reduce the query times for such queries. --- .../java/org/apache/druid/metadata/SQLMetadataConnector.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/main/java/org/apache/druid/metadata/SQLMetadataConnector.java b/server/src/main/java/org/apache/druid/metadata/SQLMetadataConnector.java index c41ca075fa3..80a81b44be4 100644 --- a/server/src/main/java/org/apache/druid/metadata/SQLMetadataConnector.java +++ b/server/src/main/java/org/apache/druid/metadata/SQLMetadataConnector.java @@ -280,7 +280,7 @@ public abstract class SQLMetadataConnector implements MetadataStorageConnector ), StringUtils.format("CREATE INDEX idx_%1$s_used ON %1$s(used)", tableName), StringUtils.format( - "CREATE INDEX idx_%1$s_datasource_used_end ON %1$s(dataSource, used, %2$send%2$s)", + "CREATE INDEX idx_%1$s_datasource_used_end_start ON %1$s(dataSource, used, %2$send%2$s, start)", tableName, getQuoteString() )