Last active
November 10, 2021 21:02
-
-
Save bobvawter/888ddd5ea3b6a57bb4a30490239c768d to your computer and use it in GitHub Desktop.
Summarize contention events in CockroachDB
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
WITH c AS ( | |
SELECT DISTINCT ON (table_id, index_id) | |
table_id, | |
index_id, | |
num_contention_events AS events, | |
cumulative_contention_time AS times | |
FROM crdb_internal.cluster_contention_events | |
) | |
SELECT i.descriptor_name, i.index_name, c.events, c.times | |
FROM crdb_internal.table_indexes AS i | |
JOIN c ON i.descriptor_id = c.table_id AND i.index_id = c.index_id; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment