teradata sql解释计划果然够恶心,都不知道从哪开始研究。
EXPLAIN SELECT * FROM DBC.TABLESIZE
Explanation
1) First, we lock DBC.DataBaseSpace for access, we lock DBC.TVM for
access, and we lock DBC.Dbase for access.
2) Next, we flush the DISKSPACE and AMPUSAGE caches.
3) We do an all-AMPs RETRIEVE step from DBC.Dbase by way of an
all-rows scan with no residual conditions into Spool 2 (all_amps),
which is duplicated on all AMPs. The size of Spool 2 is estimated
with low confidence to be 20,164 rows. The estimated time for
this step is 0.08 seconds.
4) We do an all-AMPs JOIN step from Spool 2 (Last Use) by way of an
all-rows scan, which is joined to DBC.TVM by way of an all-rows
scan with no residual conditions. Spool 2 and DBC.TVM are joined
using a single partition hash_ join, with a join condition of (
"DBC.TVM.DatabaseId = DatabaseId"). The result goes into Spool 3
(all_amps), which is redistributed by hash code to all AMPs. The
size of Spool 3 is estimated with index join confidence to be
35,926 rows. The estimated time for this step is 0.14 seconds.
5) We do an all-AMPs RETRIEVE step from DBC.DataBaseSpace by way of
an all-rows scan with a condition of ("DBC.DataBaseSpace.TableId
<> '000000000000'XB") into Spool 4 (all_amps), which is
redistributed by hash code to all AMPs. The size of Spool 4 is
estimated with no confidence to be 3,462,486 rows. The estimated
time for this step is 0.72 seconds.
6) We do an all-AMPs JOIN step from Spool 3 (Last Use) by way of an
all-rows scan, which is joined to Spool 4 (Last Use) by way of an
all-rows scan. Spool 3 and Spool 4 are joined using a single
partition hash join, with a join condition of ("(DatabaseId =
DatabaseId) AND ((DatabaseId = DatabaseId) AND (TableId = TVMId ))").
The result goes into Spool 1 (group_amps), which is built locally
on the AMPs. The size of Spool 1 is estimated with no confidence
to be 3,462,486 rows. The estimated time for this step is 0.63
seconds.
7) Finally, we send out an END TRANSACTION step to all AMPs involved
in processing the request.
-> The contents of Spool 1 are sent back to the user as the result of
statement 1.
阅读(2079) | 评论(0) | 转发(0) |