开发者

Use of AMPs in create table command in Teradata

I am new to Teradata. Can anyone tell me How exactly the AMPs going to helpful in creation of any table in Teradata. Lets have a scenario. I have a Teradata database with 4 AMPs. I learned that AMPs will usefull when we inserting the data into a table. Depending on the indexes it will distribute the data with the help of respected AMPs. But while creating the table, the command needs to execute through AMPs only. So开发者_开发百科 i want to know which AMP will be used at that time??


The actual creation of the table in the data dictionary is a RowHash level operation involving a single AMP to store the record in DBC.TVM. Based on the other actions listed in the EXPLAIN there may be other AMPs involved as well but there is not single All-AMP operation. (This doesn't take into consideration the loading of the data and its distribution across the AMPs.)

Sample EXPLAIN:

  1) First, we lock FUBAR.ABC for exclusive use. 
  2) Next, we lock a distinct DBC."pseudo table" for write on a RowHash
     for deadlock prevention, we lock a distinct DBC."pseudo table" for
     write on a RowHash for deadlock prevention, we lock a distinct
     DBC."pseudo table" for read on a RowHash for deadlock prevention,
     and we lock a distinct DBC."pseudo table" for write on a RowHash
     for deadlock prevention. 
  3) We lock DBC.DBase for read on a RowHash, we lock DBC.Indexes for
     write on a RowHash, we lock DBC.TVFields for write on a RowHash,
     we lock DBC.TVM for write on a RowHash, and we lock
     DBC.AccessRights for write on a RowHash. 
  4) We execute the following steps in parallel. 
       1) We do a single-AMP ABORT test from DBC.DBase by way of the
          unique primary index. 
       2) We do a single-AMP ABORT test from DBC.TVM by way of the
          unique primary index. 
       3) We do an INSERT into DBC.Indexes (no lock required). 
       4) We do an INSERT into DBC.TVFields (no lock required). 
       5) We do an INSERT into DBC.TVM (no lock required). 
       6) We INSERT default rights to DBC.AccessRights for FUBAR.ABC. 
  5) We create the table header. 
  6) 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. 
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜