2011-06-06 66 views
1

我是Teradata的新手。任何人都可以告訴我AMP如何幫助創建Teradata中的任何表格。 讓我們有一個場景。 我有一個4 AMP的Teradata數據庫。當我們將數據插入表格時,我瞭解到AMPs將會很有用。根據索引,它將在受尊敬的AMP的幫助下分發數據。但在創建表格時,該命令只需通過AMP執行。所以我想知道當時使用哪種AMP?在Teradata中使用AMP創建表命令

回答

1

數據字典中表格的實際創建是一個RowHash級別的操作,涉及單個AMP將記錄存儲在DBC.TVM中。根據EXPLAIN中列出的其他操作,可能還會涉及其他AMP,但沒有單個All-AMP操作。 (這不考慮到數據的加載和跨省級分佈。)

樣品講解:

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

謝謝羅布.. – Avin 2011-06-07 05:15:45