How DSA Uses AMP Worker Tasks

Blog
The best minds from Teradata, our partners, and customers blog about whatever takes their fancy.
Teradata Employee

AMP worker tasks (AWT) are a critical resource in the Teradata Database.   In previous blog postings I’ve explained how the load and export utilities, as well as ARC backup and restore, use AMP worker tasks.  In this posting we’ll consider the replacement for ARC, Data Stream Architecture (DSA), and its use of AWTs.

 

DSA Backup

A DSA backup will require only one AWT per AMP. However, if there is a down AMP, then two AWTs per AMP will be required.

 

DSA Restore Data Phase –Same Configuration

When the configuration is the same, the use of AWTs by DSA for the Data Phase is simple and straightforward. A single AWT per AMP is required, unless there is a down AMP, then 2 AWTs will be needed.

 

DSA Restore Data Phase - Different Configuration

When DSA is restoring to a different configuration, more work is involved in getting the data to the correct AMP, and different tasks are needed to accomplish that. Consequently more AWTs will be required.

For the Data Phase of a restore, DSA may use up to five AMP worker tasks per AMP, but in most cases only four will be active at the same time. Those five AWTs are used in the following way:

  1. During the Data Phase, there is a single AWT that prepares for sender activity on each AMP. This preliminary task runs alone on each AMP, but could overlap slightly with the other tasks that follow. It uses an AWT of the Work00 work type.
  2. A sender task collects data and sends it to the correct AMP’s receiver task. It uses an AWT of the Work00 work type.
  3. A receiver task on each AMP receives and buffers the rows that belong on the AMP for the sorter task. This task uses a Work01 work type AWTs.
  4. A pre-sorter task does the initial sort of the data on each AMP, and uses a Work00 AWT.

AWTs for tasks 2, 3, and 4 above will be running at the same time and are expected to be in use for most of the Data Phase’s duration.

  1. In addition, there will be a 5th AWT required for: 1.) a final sort operation, and 2.) updating the table header. Those two tasks are run sequentially, so in combination they never require more than a single AWT between them.

 

DSA Restore Build Phase - Same or Different Configuration

The Build Phase uses the same logic, whether the restore is to the same or a different configuration, and can use up to 55 AWTs.  This large number of AWTs is needed because DSA supports  the building of five tables at a time, including each table’s associated objects.  But because the number of tables being built concurrently can vary from 1 to 5,  and different tables have different characteristics, the total number of AWTs required by the Build Phase will vary as well.

The actual number of AWTs that will be in use during a particular restore Build Phase will depend on the number of tables being built concurrently, the number of indexes on each table, whether or not each table being built includes fallback, and whether or not LOBs (and how many) are contained within each table.

For the maximum number of AWTs of 55 to be required, the user must have specified five tables to be built concurrently. Up to five indexes can be built at the same time, but as mentioned earlier, DSA’s ability to do work in parallel requires additional AWTs to accomplish.

Note: When the restore is to the same configuration, the Data Phase and the Build Phase have been designed to happen at the same time.  In combination, the two phases could use up to 56 AWTs.

When the restore is to a different configuration, the Data Phase and the Build Phase cannot run at the same time in Teradata Database release 15.10 or earlier. However, in 16.0 and above,  the two phases are able to run together.  In that case the maximum number of AWTs that could be used for the combined phases is 60.

 

Conclusions

DSA is architected for throughput and speed of completion. Users cannot access the data until all the tables and their associated objects have been fully restored.  Consequently, DSA has the potential of taking control of almost all of your AWTs to support quick completion of its work.