Tracking changes on a table

Your design has a big disadvantage: Getting just the current values (which you will work with most of the time) is an expensive operation that requires a join.

Your system would be much faster if you have a table with the current data and an extra table for historical information, consisting of all columns of users and a valid_until timestamp column, with a primary key over (user_id,valid_until).


One issue that you did not tell relates to the frequency of changes in the various attributes (columns) which object USER (table users) has.

Suppose you have a temporal table which has P columns of which only K, where K is much smaller than P, are usually subject to change. Then having everything on the same table or having only two tables (current records, historical records) will generate more new records than would be necessary.

Would it be possible to split attributes into different tables and having at least two temporal columns (transaction_validfrom,transaction_validto)?

I have to admit that some joins would be necessary to combine columns from different tables into one row but generally those tables having splitted attributes are smaller sou you win in I/O.