EXPLAIN json=0 SELECT l_returnflag, l_linestatus, sum(l_quantity) AS sum_qty, sum(l_extendedprice) AS sum_base_price, sum(l_extendedprice * (1 - l_discount)) AS sum_disc_price, sum((l_extendedprice * (1 - l_discount)) * (1 + l_tax)) AS sum_charge, avg(l_quantity) AS avg_qty, avg(l_extendedprice) AS avg_price, avg(l_discount) AS avg_disc, count(*) AS count_order FROM lineitem WHERE l_shipdate <= (toDate('1998-12-01') - toIntervalDay('90')) GROUP BY l_returnflag, l_linestatus ORDER BY l_returnflag ASC, l_linestatus ASC
EXPLAIN DISTRIBUTED json=0 SELECT l_returnflag, l_linestatus, sum(l_quantity) AS sum_qty, sum(l_extendedprice) AS sum_base_price, sum(l_extendedprice * (1 - l_discount)) AS sum_disc_price, sum((l_extendedprice * (1 - l_discount)) * (1 + l_tax)) AS sum_charge, avg(l_quantity) AS avg_qty, avg(l_extendedprice) AS avg_price, avg(l_discount) AS avg_disc, count(*) AS count_order FROM lineitem WHERE l_shipdate <= (toDate('1998-12-01') - toIntervalDay('90')) GROUP BY l_returnflag, l_linestatus ORDER BY l_returnflag ASC, l_linestatus ASC
Explain analyze通用setting
json = 1 打印JSON格式的计划 默认0
stats=1 输出统计信息行数和cost 默认1
profile =1 输出执行时profiles 默认1
verbose =1 输出逻辑计划node详细内容 默认1
EXPLAIN ANALYZE json=0 SELECT l_returnflag, l_linestatus, sum(l_quantity) AS sum_qty, sum(l_extendedprice) AS sum_base_price, sum(l_extendedprice * (1 - l_discount)) AS sum_disc_price, sum((l_extendedprice * (1 - l_discount)) * (1 + l_tax)) AS sum_charge, avg(l_quantity) AS avg_qty, avg(l_extendedprice) AS avg_price, avg(l_discount) AS avg_disc, count(*) AS count_order FROM lineitem WHERE l_shipdate <= (toDate('1998-12-01') - toIntervalDay('90')) GROUP BY l_returnflag, l_linestatus ORDER BY l_returnflag ASC, l_linestatus ASC
EXPLAIN ANALYZE DISTRIBUTED json=0 SELECT l_returnflag, l_linestatus, sum(l_quantity) AS sum_qty, sum(l_extendedprice) AS sum_base_price, sum(l_extendedprice * (1 - l_discount)) AS sum_disc_price, sum((l_extendedprice * (1 - l_discount)) * (1 + l_tax)) AS sum_charge, avg(l_quantity) AS avg_qty, avg(l_extendedprice) AS avg_price, avg(l_discount) AS avg_disc, count(*) AS count_order FROM lineitem WHERE l_shipdate <= (toDate('1998-12-01') - toIntervalDay('90')) GROUP BY l_returnflag, l_linestatus ORDER BY l_returnflag ASC, l_linestatus ASC
EXPLAIN AST SELECT l_returnflag, l_linestatus, sum(l_quantity) AS sum_qty, sum(l_extendedprice) AS sum_base_price, sum(l_extendedprice * (1 - l_discount)) AS sum_disc_price, sum((l_extendedprice * (1 - l_discount)) * (1 + l_tax)) AS sum_charge, avg(l_quantity) AS avg_qty, avg(l_extendedprice) AS avg_price, avg(l_discount) AS avg_disc, count(*) AS count_order FROM lineitem WHERE l_shipdate <= (toDate('1998-12-01') - toIntervalDay('90')) GROUP BY l_returnflag, l_linestatus ORDER BY l_returnflag ASC, l_linestatus ASC
EXPLAIN SYNTAX SELECT l_returnflag, l_linestatus, sum(l_quantity) AS sum_qty, sum(l_extendedprice) AS sum_base_price, sum(l_extendedprice * (1 - l_discount)) AS sum_disc_price, sum((l_extendedprice * (1 - l_discount)) * (1 + l_tax)) AS sum_charge, avg(l_quantity) AS avg_qty, avg(l_extendedprice) AS avg_price, avg(l_discount) AS avg_disc, count(*) AS count_order FROM lineitem WHERE l_shipdate <= (toDate('1998-12-01') - toIntervalDay('90')) GROUP BY l_returnflag, l_linestatus ORDER BY l_returnflag ASC, l_linestatus ASC
EXPLAIN TRACE_OPT SELECT l_returnflag, l_linestatus, sum(l_quantity) AS sum_qty, sum(l_extendedprice) AS sum_base_price, sum(l_extendedprice * (1 - l_discount)) AS sum_disc_price, sum((l_extendedprice * (1 - l_discount)) * (1 + l_tax)) AS sum_charge, avg(l_quantity) AS avg_qty, avg(l_extendedprice) AS avg_price, avg(l_discount) AS avg_disc, count(*) AS count_order FROM lineitem WHERE l_shipdate <= (toDate('1998-12-01') - toIntervalDay('90')) GROUP BY l_returnflag, l_linestatus ORDER BY l_returnflag ASC, l_linestatus ASC
EXPLAIN TRACE_OPT RULE SELECT l_returnflag, l_linestatus, sum(l_quantity) AS sum_qty, sum(l_extendedprice) AS sum_base_price, sum(l_extendedprice * (1 - l_discount)) AS sum_disc_price, sum((l_extendedprice * (1 - l_discount)) * (1 + l_tax)) AS sum_charge, avg(l_quantity) AS avg_qty, avg(l_extendedprice) AS avg_price, avg(l_discount) AS avg_disc, count(*) AS count_order FROM lineitem WHERE l_shipdate <= (toDate('1998-12-01') - toIntervalDay('90')) GROUP BY l_returnflag, l_linestatus ORDER BY l_returnflag ASC, l_linestatus ASC
EXPLAIN METADATA json = 0 SELECT l_returnflag, l_linestatus, sum(l_quantity) AS sum_qty, sum(l_extendedprice) AS sum_base_price, sum(l_extendedprice * (1 - l_discount)) AS sum_disc_price, sum((l_extendedprice * (1 - l_discount)) * (1 + l_tax)) AS sum_charge, avg(l_quantity) AS avg_qty, avg(l_extendedprice) AS avg_price, avg(l_discount) AS avg_disc, count(*) AS count_order FROM lineitem WHERE l_shipdate <= (toDate('1998-12-01') - toIntervalDay('90')) GROUP BY l_returnflag, l_linestatus ORDER BY l_returnflag ASC, l_linestatus ASC