Quantcast
Channel: Teradata Forums - Database
Viewing all articles
Browse latest Browse all 14773

Explain plan for set table - response (1) by VBurmist

$
0
0

 
Hello Abin,
you have really provided the answer in the first paragraph, the are no additional steps.   The phrase "defined as set and then altered it as set" has the "set" mentioned twice, but I guess you mean one "set" and one "multiset".
 
The reason is that the duplicate check is performed not before and not after the insert, but during the insert, and only for the rows being inserted.   The check is performed on the AMP level, not on the system level.    Why?   Remember that rows in regular Teradata tables are stored in PI rowhash sequence (PPI and NoPI are a bit different).   When new rows are added, they are not added at the end of the table, but at the proper blocks to ensure the rowhash sequence.    Therefore, it is convenient to do the duplicate check during the insert:   for a given row, the AMP locates the data block where the row should be inserted, and if there is a duplicate row that already exists, then that row is located in that data block (duplicate row - same PI value - same rowhash value).   So, it is convenient to check the duplicates right during the insert operation.
 
Regards,
Vlad.
 


Viewing all articles
Browse latest Browse all 14773

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>