【hive优化】SQL优化之where:将最大数据量的条件放在where最后

HiveSQL优化之where:将最大数据量的条件放在where最后

今天在hive2测试了一下查询400多万的数据量,两个条件分别为account和calc_date
select count(*) from tb_test where account = '123456' and calc_date = '2019-09-01'

select count(*) from tb_test where calc_date = '2019-09-01' and account = '123456'
分别测试了十次,最终平均时间分别如下:


注:仅代表当时的测试,不代表全部。

猜你喜欢

转载自blog.csdn.net/debimeng/article/details/102734153