pranavbhole commented on code in PR #14470:
URL: https://github.com/apache/druid/pull/14470#discussion_r1239108943


##########
server/src/main/java/org/apache/druid/metadata/SQLMetadataConnector.java:
##########
@@ -377,8 +380,20 @@ public void createEntryTable(final String tableName)
                 + "  PRIMARY KEY (id)\n"
                 + ")",
                 tableName, getPayloadType(), getCollation()
-            ),
-            StringUtils.format("CREATE INDEX idx_%1$s_active_created_date ON 
%1$s(active, created_date)", tableName)
+            )
+        )
+    );
+    createIndex(
+        tableName,
+        "active_created",
+        StringUtils.format("CREATE INDEX idx_%1$s_active_created_date ON 
%1$s(active, created_date)", tableName)
+    );
+    createIndex(
+        tableName,
+        "datasource_active",
+        StringUtils.format(
+            "CREATE INDEX idx_%1$s_datasource_active_date ON %1$s(datasource, 
active)",
+            tableName

Review Comment:
   We are creating index along with the createTable method for all meta tables, 
thus putting it along with Create table. 
   Ideally We should migrate other create index statements to this new 
construct, so that we attempt to create the indexes if they are missing esp 
older installations. 



-- 
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]

Reply via email to