我面临雪花EXPLAIN
查询的一个问题。正如雪花文档中提到的,我在雪花实例中执行了以下查询,但它给出了不同的输出。
创建表:
create table z1 (id integer);
create table z2 (id integer);
create table z3 (id integer);
为查询生成表格格式的 EXPLAIN 计划:
explain using tabular select z1.id, z2.id
from z1, z2
where z2.id = z1.id;
预期输出:
+------+----+--------+-------------+------------------------------+-------+--------------------------+-----------------+--------------------+---------------+
| step | id | parent | operation | objects | alias | expressions | partitionsTotal | partitionsAssigned | bytesAssigned |
|------+----+--------+-------------+------------------------------+-------+--------------------------+-----------------+--------------------+---------------|
| NULL | NULL | NULL | GlobalStats | NULL | NULL | NULL | 2 | 2 | 1024 |
| 1 | 0 | NULL | Result | NULL | NULL | Z1.ID, Z2.ID | NULL | NULL | NULL |
| 1 | 1 | 0 | InnerJoin | NULL | NULL | joinKey: (Z2.ID = Z1.ID) | NULL | NULL | NULL |
| 1 | 2 | 1 | TableScan | TESTDB.TEMPORARY_DOC_TEST.Z2 | NULL | ID | 1 | 1 | 512 |
| 1 | 3 | 1 | JoinFilter | NULL | NULL | joinKey: (Z2.ID = Z1.ID) | NULL | NULL | NULL |
| 1 | 4 | 3 | TableScan | TESTDB.TEMPORARY_DOC_TEST.Z1 | NULL | ID | 1 | 1 | 512 |
+------+----+--------+-------------+------------------------------+-------+--------------------------+-----------------+--------------------+---------------+
实际输出:
+-----+----+-------+-----------+--------+------+------------+----------------+-------------------+--------------+
|step |id |parent |operation |objects |alias |expressions |partitionsTotal |partitionsAssigned |bytesAssigned |
+-----+----+-------+-----------+--------+------+------------+----------------+-------------------+--------------+
|NULL |NULL|NULL |GlobalStats|NULL |NULL |NULL |0 |0 |0 |
|1 |0 |NULL |Result |NULL |NULL |Z1.ID, Z2.ID|NULL |NULL |NULL |
|1 |1 |0 |Generator |NULL |NULL |0 |NULL |NULL |NULL |
+-----+--- +-------+-----------+--------+------+------------+----------------+-------------------+--------------+
在实际输出中,我看不到 , 等操作的结果TableScan
。JoinFilter
我InnerJoin
不确定是否必须在雪花实例中进行任何设置?
我们计划使用 的输出EXPLAIN
从SELECT
查询中提取表名。