Draw a diagram from below teradata explain plan 1) First, we lock…
- User
Draw a diagram from below teradata explain plan
- First, we lock QS_RETAIL_DB.Final_SupervisedPrediction_Dataset in
view ml__select__1710325988952254 in TD_MAP1 for read on a
reserved RowHash to prevent global deadlock. - Next, we lock QS_RETAIL_DB.Final_SupervisedPrediction_Dataset in
view ml__select__1710325988952254 in TD_MAP1 for read. - We do an all-AMPs RETRIEVE step in TD_MAP1 from
QS_RETAIL_DB.Final_SupervisedPrediction_Dataset in view
ml__select__1710325988952254 by way of an all-rows scan with a
condition of ("NOT
(QS_RETAIL_DB.Final_SupervisedPrediction_Dataset in view
ml__select__1710325988952254.reordered IS NULL)") into Spool 10
(all_amps), which is built locally on the AMPs. The size of Spool 10 is estimated with no confidence to be 688,781 rows (36,505,393 bytes). The estimated time for this step is 0.10 seconds. - We do an all-AMPs SAMPLING step in TD_Map1 from Spool 10 (Last
Use) by way of an all-rows scan into Spool 2 (all_amps), which is built locally on the AMPs. Samples are specified as a fraction of total rows. The size of Spool 2 is estimated with no confidence
to be 688,781 rows (39,260,517 bytes). - We execute the following steps in parallel.
- We do an all-AMPs RETRIEVE step in TD_Map1 from Spool 2 (Last
Use) by way of an all-rows scan with a condition of (
"ml__sample__1710327996552395."SAMPLEID" = 2") into Spool 5
(used to materialize view, derived table, table function or
table operator TblOpInputSpool) (all_amps), which is built
locally on the AMPs. The size of Spool 5 is estimated with
no confidence to be 688,781 rows (36,505,393 bytes). The
estimated time for this step is 0.10 seconds. - We do a single-AMP RETRIEVE step from TD_COE.byom_models in
view QS_RETAIL_DB.ml__filter__1710327924691940 by way of the unique primary index "TD_COE.byom_models in view
QS_RETAIL_DB.ml__filter__1710327924691940.model_id =
'instacart_prodPredict_rf_model'" with a residual condition
of ("(TD_COE.byom_models in view
QS_RETAIL_DB.ml__filter__1710327924691940.model_id )=
'instacart_prodPredict_rf_model'") into Spool 7 (used to
materialize view, derived table, table function or table
operator TblOpInputSpool) (all_amps), which is duplicated on all AMPs in TD_Map1. The size of Spool 7 is estimated with
high confidence to be 48 rows (5,520 bytes). The estimated
time for this step is 0.01 seconds.
- We do an all-AMPs RETRIEVE step in TD_Map1 from Spool 2 (Last
Use) by way of an all-rows scan with a condition of (
- We do an all-AMPs RETRIEVE step executing table operator
TD_MLDB.ONNXPredict in TD_MAP1 with a condition of ("(1=1)"). The size of Spool 9 is estimated with no confidence to be 688,781 rows (236,251,883 bytes). The estimated time for this step is 0.10 seconds. -> The contents of Spool 9 are sent back to the user as the result of statement 1.
- First, we lock QS_RETAIL_DB.Final_SupervisedPrediction_Dataset in
view ml__select__1710325988952254 in TD_MAP1 for read on a
- Assistant
To illustrate the Teradata explain plan you provided as a text-based diagram, we'll outline the process step by step, layering each part according to the order of operations. Note that actual visual diagramming would involve graphical representation, which isn't possible through text, but I'll aim to structure the explanation in a way that helps visualize the flow:
1. Lock Step: [Lock QS_RETAIL_DB.Final_SupervisedPrediction_Dataset for read to prevent deadlock] | V 2. Lock Step (continued): [Lock QS_RETAIL_DB.Final_SupervisedPrediction_Dataset for read] | V 3. Retrieve Step (All AMPs): [All-rows scan of QS_RETAIL_DB.Final_SupervisedPrediction_Dataset | Condition: NOT NULL reordered] |--> [Data goes into Spool 10 (est. 688,781 rows, 36,505,393 bytes)] | V 4. Sampling Step (All AMPs): [All-rows scan from Spool 10] |--> [Data sampled and stored in Spool 2 (est. 688,781 rows, 39,260,517 bytes)] | V 5. Parallel Execution Step: |- 1) Retrieve Step (All AMPs): | [All-rows scan from Spool 2 | Condition: "SAMPLEID" = 2] | |--> [Data in Spool 5 (est. 688,781 rows, 36,505,393 bytes)] | |- 2) Single-AMP Retrieve Step: | [Scan TD_COE.byom_models | Condition: model_id = 'instacart_prodPredict_rf_model'] | |--> [Data in Spool 7 (est. 48 rows, 5,520 bytes), duplicated across all AMPs] | V 6. Retrieve Step (All AMPs, executing table operator TD_MLDB.ONNXPredict): [Condition: "(1=1)"] |--> [Results in Spool 9 (est. 688,781 rows, 236,251,883 bytes)] | V [Results of Spool 9 sent back to user] - User
Create hierarchical view from below steps
- Lock Step: [Lock QS_RETAIL_DB.Final_SupervisedPrediction_Dataset for read to prevent deadlock]
- Retrieve Step (All AMPs): [All-rows scan of QS_RETAIL_DB.Final_SupervisedPrediction_Dataset Condition: NOT NULL reordered] –> [Data goes into Spool 10 (est. 688,781 rows, 36,505,393 bytes)]
- Sampling Step (All AMPs): [All-rows scan from Spool 10] –> [Data sampled and stored in Spool 2 (est. 688,781 rows, 39,260,517 bytes)]
- Parallel Execution Step:
-
- Retrieve Step (All AMPs): [All-rows scan from Spool 2 Condition: “SAMPLEID” = 2] –> [Data in Spool 5 (est. 688,781 rows, 36,505,393 bytes)]
-
- Single-AMP Retrieve Step: [Scan TD_COE.byom_models Condition: model_id = ‘instacart_prodPredict_rf_model’] –> [Data in Spool 7 (est. 48 rows, 5,520 bytes), duplicated across all AMPs]
- Retrieve Step (All AMPs, executing table operator TD_MLDB.ONNXPredict): [Condition: “(1=1)”] –> [Results in Spool 9 (est. 688,781 rows, 236,251,883 bytes)] [Results of Spool 9 sent back to user]
- Assistant
To create a hierarchical view from the given steps, we'll format it in a way that represents the order and dependency of operations, showing how data flows through the plan from the initial locking step to the final output back to the user. Spool files serve as intermediaries at various stages.