SET QUERY_BAND FOR SESSION、プロキシ ユーザー、および揮発性一時テーブルとグローバル一時テーブルの削除 - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQLデータ定義言語 詳細トピック

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
2020年6月
ft:locale
ja-JP
ft:lastEdition
2021-03-30
dita:mapPath
ja-JP/jpx1556733107962.ditamap
dita:ditavalPath
ja-JP/jpx1556733107962.ditaval
dita:id
B035-1184
Product Category
Software
Teradata Vantage

SET QUERY_BAND FOR SESSIONリクエストがプロキシ ユーザーを設定、変更、または削除すると、Teradata Databaseはセッションから揮発性一時テーブルと実体化された一時テーブルもすべて削除します。実体化されたグローバル一時テーブルの場合、そのためにDBC.TempTablesおよびDBC.TempStatisticsシステム テーブルに追加ロックが掛けられます。次のEXPLAINレポートを見てください。ロック動作を太字で強調しています。

EXPLAIN SET QUERY_BAND = 'PROXYUSER=dg12345;' FOR SESSION;

 *** Help information returned. 17 rows.
 *** Total elapsed time was 1 second.

Explanation
------------------------------------------------------------------
 1) First,  we lock DBC.TempStatistics for write on a RowHash, 
    and  welock DBC.TempTables for write on a RowHash.
 2) Next, we will apply the QUERY_BAND to the session.
 3) We get the volatile and temporary table ids and delete the
    corresponding table headers and data.
 4) We execute the following steps in parallel.
      1) We do a single-AMP DELETE from DBC.TempTables by way of
         the primary index with no residual conditions.
      2) We do a single-AMP DELETE from DBC.TempStatistics by way
         of the primary index with no residual conditions.
 3) We do a single-AMP UPDATE from DBC.SessionTbl by way of the
    primary index with no residual conditions.
 5) 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.

SET QUERY_BAND FOR TRANSACTIONリクエストでプロキシ ユーザーを設定した場合、Teradata Databaseは揮発性一時テーブルおよび実体化された一時テーブルを削除ない