If two events X and Y happen concurrently relative to one another but such that X is causally before Y, what timestamp mechanism can I use in a column that will accurately reflect these causal relationships? e.g. I need a cluster-wide transaction timestamp that reflects transaction order s.t. for any transaction A and B, if timestamp Ta < Tb, I need a CockroachDB timestamp that reflects this in the column. Something analogous to Spanner’s commit timestamp.
From the documentation, it looks like the current_timestamp(…) methods (and it’s variants) aren’t appropriate. The documentation states that these forms of timestamps have no relationship with the commit order of concurrent transactions. But the statement_timestamp looks like it could be a potential candidate?
What is the appropriate date/time function to capture the timestamp that reflects relative causal ordering or cluster-wide commit order? I need something analogous to the commit timestamp that Spanner offers.