You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by reveen joe <im...@gmail.com> on 2015/05/19 18:56:15 UTC

Order of Partition column and Non Partition column in the WHERE clause

Hello,



Would the order of partition column in the where clause matter for
performance?



For eg: would there be any difference in performance in the below queries?



select a from table where part_column = ‘y’  and non_part_column = ‘z’



or



select a from table where non_part_column = ‘z’ and part_column = ‘y’



Also, how can I make sure that “partition pruning” is working as intended
when checking the execution plan?



Thanks in advance.

Re: Order of Partition column and Non Partition column in the WHERE clause

Posted by Gopal Vijayaraghavan <go...@apache.org>.
> Would the order of partition column in the where clause matter for
>performance?

No, unless you have more complex predicates than an AND.

There¹s one recent regression though -
https://issues.apache.org/jira/browse/HIVE-10122

Which release are you on?

> Also, how can I make sure that ³partition pruning² is working as
>intended when checking the execution plan?
 

explain extended <query>

shows all the partitions being read via the Path -> Partition section.

Cheers,
Gopal