The one part I don’t understand with truncating/replacing the table is that if you create table_deleted_records
based solely on the current contents of table
, and then subtract one from the other, won’t your result be an empty set? How do you keep track of the records which have been deleted if you truncate table_deleted_records
and rebuild from scratch every time?