Sat hash Diff Calculation

Usually hash difference in satellite calculates on user columns. it is like md5(name+address+pincode+country).

is it good to include foreign keys in hash diff calculation ?
md5(name+address+pincode+country+region_id(fkey)).
if yes, suppose there is no change in descriptive attributes but change in foreign key column data then hashdiff value changes and tries to insert into satellite a new record which is incorrect right.

I would expect hashdiff to calculate across all source columns that feed into a sat, excluding any DV columns and other metadata columns you may add. If, in your example, a foreign key changes then surely that should be noted as a change in the sat row (as FK is in the source row and is part of the data attributes) and a new row inserted as hashdiff will be different. The only keys in a sat should be the business key from a hub/link or dependant child keys, but even the latter would be part of the source data anyway.

Hope that makes sense!

Andy

1 Like