|
|
Archives of the TeradataForum
Message Posted: Tue, 11 Dec 2012 @ 20:25:01 GMT
Subj: | | Re: Collect stats inside a macro |
|
From: | | Vinay Bagare |
Explain collect stats pdcrdata.dbqlogtbl_hst column (UserName)
1) First, we lock pdcrdata.dbqlogtbl_hst for access.
2) Next, we do a COLLECT STATISTICS step from pdcrdata.dbqlogtbl_hst
by way of an all-rows scan into Spool 3 (all_amps), which is built
locally on the AMPs by using cache during local aggregation.
3) Then we save the UPDATED STATISTICS from Spool 3 (Last Use) into
Spool 4, which is built locally on the AMP derived from
DBC.TVFields by way of the primary index.
4) We lock DBC.TVFields for write on a RowHash.
5) We do a single-AMP MERGE DELETE to DBC.TVFields from Spool 4 (Last
Use) by way of a RowHash match scan. New updated rows are built
and the result goes into Spool 5 (one-amp), which is built locally
on the AMPs.
6) We do a single-AMP MERGE into DBC.TVFields from Spool 5 (Last Use).
7) We spoil the parser's dictionary cache for the table.
8) Finally, we send out an END TRANSACTION step to all AMPs involved
in processing the request.
-> No rows are returned to the user as the result of statement 1.
Access lock on the table, Write lock on DBC.TVFields.
Thanks,
Vinay Bagare
| |