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.