I would do exactly what your friend suggested. Thus, only calls to the replication procedure will update the timestamp.
The problem with this approach is that you need write lock, but I don't see any other practical way.
Otherwise, you could use a trigger that fires when a row is retrieved (don't quote me on this, I rarely use triggers), but that doesn't seem right (you can put an end to false positives)
source
share