wecharyu commented on code in PR #4744:
URL: https://github.com/apache/hive/pull/4744#discussion_r1440379631


##########
standalone-metastore/metastore-server/src/main/sql/derby/hive-schema-4.0.0-beta-2.derby.sql:
##########
@@ -266,9 +259,9 @@ CREATE UNIQUE INDEX "APP"."DBPRIVILEGEINDEX" ON 
"APP"."DB_PRIVS" ("AUTHORIZER",
 
 CREATE UNIQUE INDEX "APP"."DCPRIVILEGEINDEX" ON "APP"."DC_PRIVS" 
("AUTHORIZER", "NAME", "PRINCIPAL_NAME", "PRINCIPAL_TYPE", "DC_PRIV", 
"GRANTOR", "GRANTOR_TYPE");
 
-CREATE INDEX "APP"."PCS_STATS_IDX" ON "APP"."PART_COL_STATS" 
("DB_NAME","TABLE_NAME","COLUMN_NAME","PARTITION_NAME","CAT_NAME");
+CREATE INDEX "APP"."PCS_STATS_IDX" ON "APP"."PART_COL_STATS" 
("PART_ID","COLUMN_NAME");

Review Comment:
   > Dont we fetch stats by partition or by table rather than by partitionid + 
column or tableid + column.
   
   In most cases we use id + column to query stats, and all the stats query 
APIs will take use of column name, for example:
   
https://github.com/apache/hive/blob/b33b3d3454cc9c65a1879c68679f33f207f21c0e/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/RawStore.java#L1278-L1279
   
   > If we decide to change it, it will apply to a lot of script files not just 
the derby scripts.
   
   Yes, I'll double check for the related indexes in all sql scripts.



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