rahulchugh commented on code in PR #4141: URL: https://github.com/apache/hive/pull/4141#discussion_r1317889371
########## standalone-metastore/metastore-server/src/main/sql/mssql/hive-schema-4.0.0.mssql.sql: ########## @@ -101,7 +101,7 @@ CREATE TABLE PART_COL_STATS ALTER TABLE PART_COL_STATS ADD CONSTRAINT PART_COL_STATS_PK PRIMARY KEY (CS_ID); -CREATE INDEX PCS_STATS_IDX ON PART_COL_STATS (CAT_NAME, DB_NAME,TABLE_NAME,COLUMN_NAME,PARTITION_NAME); +CREATE INDEX PCS_STATS_IDX ON PART_COL_STATS (DB_NAME,TABLE_NAME,COLUMN_NAME,PARTITION_NAME, CAT_NAME); Review Comment: Ideal way would be have the column with highest cardinality come in the front of the composite key. (PARTITION_NAME, COLUMN_NAME, TABLE_NAME, DB_NAME, CAT_NAME) would be the better sequence for this index to be used efficiently. -- 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]
