While we add New AMPs does the existing HASHMAP got changed as new AMPs are being added. If so, How the existing AMPs got changed according to that as the HASHMAP and The ROWID have to incorporate the change accordingly to make sure there are No data Loss.
well, this is a complex process that obviously can not be explained in few lines here, you will have to read the documentation and manuals to understand it fully.
in simple words adding a new amp initiates a hashmap reconfiguration process. In every TPA node there are 4 types of hashmaps:
So when ever a new amp is added, a reconfiguration prcess is initiated, Primary and Reconfiguration primary hashmaps are compared and the affected rows are moved to new amps.
the formula to calculate the % of rows to be moved is:
% of rows to be moved to new amps = Number of new amps / Old amps + New amps
For detailed explaination you will have to read documentation.
Yes sure, you can read about reconfiguration and a lot more at the link below:
The RowIDs do not change when AMPs are added. A new hasmap is created to balance hashbuckets across the new configuration of AMPs, then rows within buckets that have moved are moved to their new AMP by the reconfig utility.
RowID = ROW HASH + UNIQUENESS VALUE
Row hash is detemined by the PI value, So when ever a reconfiguration occurs, the rows are just moved to the new amps because the Row Hash in the new hashmap will point to some new amps.
There is nothing changed to the row or rowids, its just a transparent movement performaed by Teradata.
Yes, agree with that. But my question is-
RowID(010101..001001)=ROWHASH(010101 --- AMP5)+(001001 ---uniqueness value)
After ading new amp,
RowID(?)= ROWHASH(100101----AMP9 as data is now in AMP9)+(10010 --uniqueness value for the amp)
Am I wrong any where?
The simple answer is:
RowID(010101..001001)=ROWHASH(010101 --- AMP9)+(001001 ---uniqueness value)
as a result of reconfiguration the hashmap is changed, the same ROWHASH passed to the new hashmap will move the row to AMP9.
the row hash was determined based on PI and is not going to change :)