1.用于统计表列和分区的数据分布情况;
2.收集的信息存储在元数据库中,用于Impala执行时自动优化查询
3.主要优化join关联方式(大表关联小表广播,大表关联大表hash),一旦设定了 hint,那么compute就不生效了
compute仅对没有设置hint的有效,并且结果集关联,并不能知道结果集的数据量,impala无法准确优化关联,就失去意义了
4.广播指将右表往左表所在的每个节点都传输一份。
hash指根据关联字段,将右表按照关联字段传输到左表对应字段的节点
全表扫描
compute stats 表
分区表扫描
compute incremental stats 表 partition(biz_date=20220218)
compute incremental stats 表 partition(biz_date<=20220218)
compute incremental stats 表 partition(biz_date >= 20211230 and biz_date <=20220218)
compute incremental stats 表 partition(biz_date !=20220218)
compute incremental stats 表 partition(biz_date in(20220201,20220210,20220218))
数据展示
未做compute前
做compute删除统计信息