Skip to content

Is there a way to extract UUID value from crdb_internal.transaction_contention_events.contending_key? #89478

Answered by matthewtodd
ilslv asked this question in Q&A
Discussion options

You must be logged in to vote

Hi, @ilslv, I dug in a bit and we don't have a very satisfying answer for you, since we're generally designing around these keys being opaque values. And crdb_internal.pretty_key formats raw bytes with Go's "%q" specifier, which we don't have any SQL function support for parsing.

But if I put this ALL CAPS DON'T DO THIS IN PRODUCTION warning here, for debugging purposes, you might have better luck pulling the bytes you want directly out of the key. The general format of the keys you're looking at is a couple of variable-length-encoded identifiers, then an 0x12 byte array marker, then the 16 bytes of the uuid, then maybe more stuff. The tricky part is not knowing how many bytes those leadi…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ilslv
Comment options

Answer selected by ilslv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants