Hi there,
I'm trying to implement a "versionned" storage for a datawarehouse system, meaning I have tables which store daily information about objects and I would like to have a row inserted (i.e. a new version) only if it differs from the most recent existing row. For instance instead of storing
version attribute1 attribute2
1 x y
2 x y
3 x y
4 z y
5 z y
6 z t
we would only keep the diffs :
version attribute1 attribute2
1 x y
4 z y
6 z t
This would save lots of space and the full table could be easily accessed through a view.
However as the tables have a large number of rows (several hundreds) I would like to avoid having to write conditions like WHERE (old.att1 != new.attr1 or old.attr2 != new.attr2 or ... or old.attr245 != new.attr245 )
So my question is: is there a way to do some kind of whole-row comparison ? For instance a hash of the full row or something similar ? Is there a standard way of solving this problem ?
Thanks a lot for any hind !
Christian