cxzl25 opened a new pull request, #4474:
URL: https://github.com/apache/hive/pull/4474

   ### What changes were proposed in this pull request?
   Add `PART_KEY_VAL` index to table `PARTITION_KEY_VALS`
   
   ### Why are the changes needed?
   Improve performance
   
   #### Current
   ```
   [pool-4-thread-1] DEBUG metastore.MetaStoreDirectSql: Direct SQL query in 
352.763678ms + 0.026622ms, the query is [select "PARTITIONS"."PART_ID" from 
"PARTITIONS"  inner join "TBLS" on "PARTITIONS"."TBL_ID" = "TBLS"."TBL_ID"     
and "TBLS"."TBL_NAME" = ?   inner join "DBS" on "TBLS"."DB_ID" = "DBS"."DB_ID"  
    and "DBS"."NAME" = ? inner join "PARTITION_KEY_VALS" "FILTER0" on 
"FILTER0"."PART_ID" = "PARTITIONS"."PART_ID" and "FILTER0"."INTEGER_IDX" = 0 
inner join "PARTITION_KEY_VALS" "FILTER1" on "FILTER1"."PART_ID" = 
"PARTITIONS"."PART_ID" and "FILTER1"."INTEGER_IDX" = 1 where ( 
(("FILTER0"."PART_KEY_VAL" = ?) and ("FILTER1"."PART_KEY_VAL" = ?)) )] 
   ```
   #### Add index
   ```
   [pool-4-thread-2] DEBUG metastore.MetaStoreDirectSql: Direct SQL query in 
13.770586ms + 0.016063ms
   ```
   
   
   ### Does this PR introduce _any_ user-facing change?
   No
   
   ### Is the change a dependency upgrade?
   No
   
   ### How was this patch tested?
   Validation in production environment
   


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