cxzl25 commented on PR #4474:
URL: https://github.com/apache/hive/pull/4474#issuecomment-1669245047
> could you elaborate how the PR improves query? e.g. What's the type of quey
In the case where we use filter conditions to prune partitions, such as
`get_partitions_by_filter` RPC.
It is mainly filtered with the field `PARTITION_KEY_VALS` of
`PARTITION_KEY_VALS`, but it does not have an index, which leads to poor
performance, especially if a table has more partitions.
```sql
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" = ?
```
--
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]