[Hive optimization] SQL optimization where: put the maximum amount of data at the end of where

HiveSQL optimized where: put the maximum data volume condition at the end of where

Today, I tested more than 4 million data queries in hive2. The two conditions are account and calc_date
select count(*) from tb_test where account = '123456' and calc_date = '2019-09-01'
and
select count(* ) from tb_test where calc_date = '2019-09-01' and account = '123456'
were tested ten times, and the final average time is as follows:


Note: It only represents the test at that time, not all.

 

Guess you like

Origin blog.csdn.net/debimeng/article/details/102734153