5 ms·
For tables that don't need to scale infinitely, and to trade off in simplicity and keeping logic in the application, I use a version column. It's the "brute fo
by Incipient 3y ago
For tables that don't need to scale infinitely, and to trade off in simplicity and keeping logic in the application, I use a version column.
It's the "brute force" type approach. It doesn't scale, has performance penalties, but it's incredibly easy to use and understand, and time walking is trivial.
Relies heavily on DISTINCT ON.
On truly old tables I've added "maintenance tasks" that push old rows into an archive/audit table.
Edit/note - I realise if you suggest this at any of the big players, you'll probably be fired on the spot.