我们通过EXPLAIN命令,查看SQL的执行计划,如下: shirley=# EXPLAIN ANALYZE SELECT t_custom.name AS customName, SUM(t_order.money) AS total_money FROM t_custom LEFT JOIN t_order ON t_custom.custom_id=t_order.custom_id WHERE t_custom.age > 18 GROUP BY t_custom.name ORDER BY total_money AS...
rollup函数使用sort耗时长,总耗时达到50s(即17号-20号算子的总耗时),(并行度32的情况下),20号算子Vector sort达24s,19号算子Vector Sore Aggregate达9s,18号算子做重分布达10s,17号算子hashagg达到8s。因此需要考虑对rollup类的分析函数考虑使用其它方式进行优化,比如用hashagg替代sortagg,避免大数据量排序性能降低。
It can be an aggregate function or a combination of multiple aggregate functions. In SQL statements, aggregate operators are classified into the following types: GroupAggregate: Data has been pre-sorted based on the GROUP BY clause. HashAggregate: Data is hash-calculated, distributed to ...
doris Aggregate查询rollup explain 查询 1. explain的作用: 例如: 1、id:id的值越大则代表越先执行。 2、select_type:常见的主要有如下六个:主要用于区别普通查询、联合查询、子查询等复杂的查询。 simple:简单的select查询,并且查询中不含子查询或者union。 primary:查询中如果有包含任何复杂的子操作,最外层查询...
AGGREGATION:Operators and steps used for queries that involve aggregate functions and GROUP BY operations. AggregateaggrOperator/step for scalar aggregate functions. HashAggregateaggrOperator/step for grouped aggregate functions. Can operate from disk by virtue of hash table spilling to disk. ...
EXPLAIN:代表优化器QO根据SQL特征预估的SQL执行计划,并非实际的执行计划,对SQL的运行有一定参考意义。 EXPLAIN ANALYZE:代表SQL真实的运行计划,相比EXPLAIN会包含更多的实际运行信息,能准确的反映出SQL的执行算子和算子耗时,可以根据算子耗时去做针对性的SQL优化。 说明 从Hologres V1.3.4x版本开始,支持通过EXPLAIN和EXPLA...