forked from cockroachdb/cockroach
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
systemschema: switch session_uuid back to session_id
The SessionID encodes a region prefix and a UUID. The initial implementation of RBR sqlliveness stored the crdb_region and the session_uuid. Now, sqlliveness stores the crdb_region and value of the SessionID. ``` SELECT * FROM system.sqlliveness; session_id | expiration | crdb_region -------------------------------------------+--------------------------------+-------------- \x01018028b91818a7584268992bb246f9755b37 | 1676502803528637593.0000000000 | \x80 (1 row) ``` Storing the complete SessionID takes an extra 3 bytes of storage but it makes it simpler to inspect the state of the system and join with tables that refer to the session_id. For example, it's possible to write this query: ``` SELECT * FROM system.sqlliveness AS s LEFT JOIN ON system.jobs AS j WHERE s.session_id = j.session_id AND s.crdb_region = 'us-central-1'; ``` Part of cockroachdb#94843 Release note: None
- Loading branch information
1 parent
fb6eb66
commit 354c45b
Showing
3 changed files
with
27 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters