Skip to content

Commit

Permalink
sql: add cpu nanos to insights tables
Browse files Browse the repository at this point in the history
Part Of #87213

Add `cpu_nanos` to
`crdb_internal.{cluster,nodes}_execution_insights` and
`crdb_internal.{cluster,nodes}_txn_execution_insights`.

Release note: None
  • Loading branch information
maryliag committed Jan 30, 2023
1 parent 3e65660 commit ada02b9
Show file tree
Hide file tree
Showing 8 changed files with 79 additions and 54 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ with schedules as (show schedules) select id from schedules where label='datates
query-sql
with schedules as (show schedules) select id, command->'backup_statement' from schedules where label='datatest' order by command->>'backup_type' asc;
----
$fullID "BACKUP INTO 'nodelocal://1/example-schedule' WITH detached"
$incID "BACKUP INTO LATEST IN 'nodelocal://1/example-schedule' WITH detached"
835701674603675649 "BACKUP INTO 'nodelocal://1/example-schedule' WITH detached"
835701674568024065 "BACKUP INTO LATEST IN 'nodelocal://1/example-schedule' WITH detached"

# Can't use the same command twice.

Expand All @@ -38,8 +38,8 @@ alter backup schedule $incID set with revision_history = false;
query-sql
with schedules as (show schedules) select id, command->'backup_statement' from schedules where label='datatest' order by command->>'backup_type' asc;
----
$fullID "BACKUP INTO 'nodelocal://1/example-schedule' WITH revision_history = false, detached"
$incID "BACKUP INTO LATEST IN 'nodelocal://1/example-schedule' WITH revision_history = false, detached"
835701674603675649 "BACKUP INTO 'nodelocal://1/example-schedule' WITH revision_history = false, detached"
835701674568024065 "BACKUP INTO LATEST IN 'nodelocal://1/example-schedule' WITH revision_history = false, detached"

# Change an option and set another.

Expand All @@ -50,8 +50,8 @@ alter backup schedule $incID set with revision_history = true, set with encrypti
query-sql
with schedules as (show schedules) select id, command->'backup_statement' from schedules where label='datatest' order by command->>'backup_type' asc;
----
$fullID "BACKUP INTO 'nodelocal://1/example-schedule' WITH revision_history = true, encryption_passphrase = '*****', detached"
$incID "BACKUP INTO LATEST IN 'nodelocal://1/example-schedule' WITH revision_history = true, encryption_passphrase = '*****', detached"
835701674603675649 "BACKUP INTO 'nodelocal://1/example-schedule' WITH revision_history = true, encryption_passphrase = '*****', detached"
835701674568024065 "BACKUP INTO LATEST IN 'nodelocal://1/example-schedule' WITH revision_history = true, encryption_passphrase = '*****', detached"

# Add an incompatible option

Expand All @@ -70,8 +70,8 @@ alter backup schedule $incID set with kms = ('aws:///key1?region=r1', 'aws:///ke
query-sql
with schedules as (show schedules) select id, command->'backup_statement' from schedules where label='datatest' order by command->>'backup_type' asc;
----
$fullID "BACKUP INTO 'nodelocal://1/example-schedule' WITH revision_history = true, detached, kms = ('aws:///redacted?region=r1', 'aws:///redacted?region=r2'), incremental_location = 'inc'"
$incID "BACKUP INTO LATEST IN 'nodelocal://1/example-schedule' WITH revision_history = true, detached, kms = ('aws:///redacted?region=r1', 'aws:///redacted?region=r2'), incremental_location = 'inc'"
835701674603675649 "BACKUP INTO 'nodelocal://1/example-schedule' WITH revision_history = true, detached, kms = ('aws:///redacted?region=r1', 'aws:///redacted?region=r2'), incremental_location = 'inc'"
835701674568024065 "BACKUP INTO LATEST IN 'nodelocal://1/example-schedule' WITH revision_history = true, detached, kms = ('aws:///redacted?region=r1', 'aws:///redacted?region=r2'), incremental_location = 'inc'"

# Set options to empty (unset).

Expand All @@ -82,8 +82,8 @@ alter backup schedule $incID set with kms = '', set with incremental_location =
query-sql
with schedules as (show schedules) select id, command->'backup_statement' from schedules where label='datatest' order by command->>'backup_type' asc;
----
$fullID "BACKUP INTO 'nodelocal://1/example-schedule' WITH revision_history = true, detached"
$incID "BACKUP INTO LATEST IN 'nodelocal://1/example-schedule' WITH revision_history = true, detached"
835701674603675649 "BACKUP INTO 'nodelocal://1/example-schedule' WITH revision_history = true, detached"
835701674568024065 "BACKUP INTO LATEST IN 'nodelocal://1/example-schedule' WITH revision_history = true, detached"

# Setting DETACHED throws an error.

Expand All @@ -100,5 +100,5 @@ regex matches error
query-sql
with schedules as (show schedules) select id, command->'backup_statement' from schedules where label='datatest' order by command->>'backup_type' asc;
----
$fullID "BACKUP INTO 'nodelocal://1/example-schedule' WITH revision_history = true, detached"
$incID "BACKUP INTO LATEST IN 'nodelocal://1/example-schedule' WITH revision_history = true, detached"
835701674603675649 "BACKUP INTO 'nodelocal://1/example-schedule' WITH revision_history = true, detached"
835701674568024065 "BACKUP INTO LATEST IN 'nodelocal://1/example-schedule' WITH revision_history = true, detached"
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ with schedules as (show schedules) select id from schedules where label='datates
query-sql
with schedules as (show schedules) select id, state, recurrence, owner, command from schedules where label='datatest' order by command->>'backup_type' asc;
----
$fullID <nil> @weekly root {"backup_statement": "BACKUP INTO 'nodelocal://1/example-schedule' WITH detached", "chain_protected_timestamp_records": true, "dependent_schedule_id": $incID, "unpause_on_success": $incID}
$incID Waiting for initial backup to complete @daily root {"backup_statement": "BACKUP INTO LATEST IN 'nodelocal://1/example-schedule' WITH detached", "backup_type": 1, "chain_protected_timestamp_records": true, "dependent_schedule_id": $fullID}
835701678254227457 <nil> @weekly root {"backup_statement": "BACKUP INTO 'nodelocal://1/example-schedule' WITH detached", "chain_protected_timestamp_records": true, "dependent_schedule_id": 835701678248722433, "unpause_on_success": 835701678248722433}
835701678248722433 Waiting for initial backup to complete @daily root {"backup_statement": "BACKUP INTO LATEST IN 'nodelocal://1/example-schedule' WITH detached", "backup_type": 1, "chain_protected_timestamp_records": true, "dependent_schedule_id": 835701678254227457}

exec-sql
drop schedule $fullID
Expand All @@ -34,8 +34,8 @@ with schedules as (show schedules) select id from schedules where label='datates
query-sql
with schedules as (show schedules) select id, state, recurrence, owner, command from schedules where label='datatest' order by command->>'backup_type' asc;
----
$fullID <nil> @weekly root {"backup_statement": "BACKUP INTO 'nodelocal://1/example-schedule' WITH detached", "chain_protected_timestamp_records": true, "dependent_schedule_id": $incID, "unpause_on_success": $incID}
$incID Waiting for initial backup to complete @daily root {"backup_statement": "BACKUP INTO LATEST IN 'nodelocal://1/example-schedule' WITH detached", "backup_type": 1, "chain_protected_timestamp_records": true, "dependent_schedule_id": $fullID}
835701678339129345 <nil> @weekly root {"backup_statement": "BACKUP INTO 'nodelocal://1/example-schedule' WITH detached", "chain_protected_timestamp_records": true, "dependent_schedule_id": 835701678337654785, "unpause_on_success": 835701678337654785}
835701678337654785 Waiting for initial backup to complete @daily root {"backup_statement": "BACKUP INTO LATEST IN 'nodelocal://1/example-schedule' WITH detached", "backup_type": 1, "chain_protected_timestamp_records": true, "dependent_schedule_id": 835701678339129345}

exec-sql
drop schedule $incID
Expand All @@ -46,7 +46,7 @@ drop schedule $incID
query-sql
with schedules as (show schedules) select id, state, recurrence, owner, command from schedules where label='datatest' order by command->>'backup_type' asc;
----
$fullID <nil> @weekly root {"backup_statement": "BACKUP INTO 'nodelocal://1/example-schedule' WITH detached", "chain_protected_timestamp_records": true}
835701678339129345 <nil> @weekly root {"backup_statement": "BACKUP INTO 'nodelocal://1/example-schedule' WITH detached", "chain_protected_timestamp_records": true}

exec-sql
alter backup schedule $fullID set recurring '@daily';
Expand All @@ -55,4 +55,4 @@ alter backup schedule $fullID set recurring '@daily';
query-sql
with schedules as (show schedules) select id, state, recurrence, owner, command from schedules where label='datatest' order by command->>'backup_type' asc;
----
$fullID <nil> @daily root {"backup_statement": "BACKUP INTO 'nodelocal://1/example-schedule' WITH detached", "chain_protected_timestamp_records": true}
835701678339129345 <nil> @daily root {"backup_statement": "BACKUP INTO 'nodelocal://1/example-schedule' WITH detached", "chain_protected_timestamp_records": true}
Loading

0 comments on commit ada02b9

Please sign in to comment.