-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sql: create system tables for SQL stats
This PR creates two new system tables: system.sql_statement_stats and system.sql_transaction_stats per RFC #63752. This is the initial step that addresses #64743. Release note: None
- Loading branch information
Showing
37 changed files
with
1,267 additions
and
643 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
debug doctor examine cluster | ||
---- | ||
debug doctor examine cluster | ||
Examining 36 descriptors and 37 namespace entries... | ||
Examining 38 descriptors and 39 namespace entries... | ||
ParentID 50, ParentSchemaID 29: relation "foo" (53): expected matching namespace entry, found none | ||
Examining 3 jobs... | ||
ERROR: validation failed |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,7 +64,7 @@ debug zip --concurrency=1 --cpu-profile-duration=0s /dev/null | |
[node 1] 1 log file ... | ||
[node 1] [log file ... | ||
[node 1] requesting ranges... received response... done | ||
[node 1] 37 ranges found | ||
[node 1] 39 ranges found | ||
[node 1] writing range 1... converting to JSON... writing binary output: debug/nodes/1/ranges/1.json... done | ||
[node 1] writing range 2... converting to JSON... writing binary output: debug/nodes/1/ranges/2.json... done | ||
[node 1] writing range 3... converting to JSON... writing binary output: debug/nodes/1/ranges/3.json... done | ||
|
@@ -102,6 +102,8 @@ debug zip --concurrency=1 --cpu-profile-duration=0s /dev/null | |
[node 1] writing range 35... converting to JSON... writing binary output: debug/nodes/1/ranges/35.json... done | ||
[node 1] writing range 36... converting to JSON... writing binary output: debug/nodes/1/ranges/36.json... done | ||
[node 1] writing range 37... converting to JSON... writing binary output: debug/nodes/1/ranges/37.json... done | ||
[node 1] writing range 38... converting to JSON... writing binary output: debug/nodes/1/ranges/38.json... done | ||
[node 1] writing range 39... converting to JSON... writing binary output: debug/nodes/1/ranges/39.json... done | ||
[node 2] node status... converting to JSON... writing binary output: debug/nodes/2/status.json... done | ||
[node 2] using SQL connection URL: postgresql://... | ||
[node 2] retrieving SQL data for crdb_internal.feature_usage... writing output: debug/nodes/2/crdb_internal.feature_usage.txt... | ||
|
@@ -220,7 +222,7 @@ debug zip --concurrency=1 --cpu-profile-duration=0s /dev/null | |
[node 3] 1 log file ... | ||
[node 3] [log file ... | ||
[node 3] requesting ranges... received response... done | ||
[node 3] 37 ranges found | ||
[node 3] 39 ranges found | ||
[node 3] writing range 1... converting to JSON... writing binary output: debug/nodes/3/ranges/1.json... done | ||
[node 3] writing range 2... converting to JSON... writing binary output: debug/nodes/3/ranges/2.json... done | ||
[node 3] writing range 3... converting to JSON... writing binary output: debug/nodes/3/ranges/3.json... done | ||
|
@@ -258,6 +260,8 @@ debug zip --concurrency=1 --cpu-profile-duration=0s /dev/null | |
[node 3] writing range 35... converting to JSON... writing binary output: debug/nodes/3/ranges/35.json... done | ||
[node 3] writing range 36... converting to JSON... writing binary output: debug/nodes/3/ranges/36.json... done | ||
[node 3] writing range 37... converting to JSON... writing binary output: debug/nodes/3/ranges/37.json... done | ||
[node 3] writing range 38... converting to JSON... writing binary output: debug/nodes/3/ranges/38.json... done | ||
[node 3] writing range 39... converting to JSON... writing binary output: debug/nodes/3/ranges/39.json... done | ||
[cluster] doctor examining cluster...... writing binary output: debug/reports/doctor.txt... done | ||
[cluster] requesting list of SQL databases... received response... done | ||
[cluster] 3 databases found | ||
|
@@ -266,7 +270,7 @@ debug zip --concurrency=1 --cpu-profile-duration=0s /dev/null | |
[cluster] [database: postgres] requesting database details... received response... converting to JSON... writing binary output: debug/schema/[email protected]... done | ||
[cluster] [database: postgres] 0 tables found | ||
[cluster] [database: system] requesting database details... received response... converting to JSON... writing binary output: debug/schema/[email protected]... done | ||
[cluster] [database: system] 31 tables found | ||
[cluster] [database: system] 33 tables found | ||
[cluster] [database: system] [table: public.comments] requesting table details... received response... converting to JSON... writing binary output: debug/schema/system/public_comments.json... done | ||
[cluster] [database: system] [table: public.descriptor] requesting table details... received response... converting to JSON... writing binary output: debug/schema/system/public_descriptor.json... done | ||
[cluster] [database: system] [table: public.eventlog] requesting table details... received response... converting to JSON... writing binary output: debug/schema/system/public_eventlog.json... done | ||
|
@@ -288,6 +292,8 @@ debug zip --concurrency=1 --cpu-profile-duration=0s /dev/null | |
[cluster] [database: system] [table: public.role_options] requesting table details... received response... converting to JSON... writing binary output: debug/schema/system/public_role_options.json... done | ||
[cluster] [database: system] [table: public.scheduled_jobs] requesting table details... received response... converting to JSON... writing binary output: debug/schema/system/public_scheduled_jobs.json... done | ||
[cluster] [database: system] [table: public.settings] requesting table details... received response... converting to JSON... writing binary output: debug/schema/system/public_settings.json... done | ||
[cluster] [database: system] [table: public.sql_statement_stats] requesting table details... received response... converting to JSON... writing binary output: debug/schema/system/public_sql_statement_stats.json... done | ||
[cluster] [database: system] [table: public.sql_transaction_stats] requesting table details... received response... converting to JSON... writing binary output: debug/schema/system/public_sql_transaction_stats.json... done | ||
[cluster] [database: system] [table: public.sqlliveness] requesting table details... received response... converting to JSON... writing binary output: debug/schema/system/public_sqlliveness.json... done | ||
[cluster] [database: system] [table: public.statement_bundle_chunks] requesting table details... received response... converting to JSON... writing binary output: debug/schema/system/public_statement_bundle_chunks.json... done | ||
[cluster] [database: system] [table: public.statement_diagnostics] requesting table details... received response... converting to JSON... writing binary output: debug/schema/system/public_statement_diagnostics.json... done | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,7 +64,7 @@ debug zip /dev/null --concurrency=1 --exclude-nodes=2 --cpu-profile-duration=0 | |
[node 1] 1 log file ... | ||
[node 1] [log file ... | ||
[node 1] requesting ranges... received response... done | ||
[node 1] 37 ranges found | ||
[node 1] 39 ranges found | ||
[node 1] writing range 1... converting to JSON... writing binary output: debug/nodes/1/ranges/1.json... done | ||
[node 1] writing range 2... converting to JSON... writing binary output: debug/nodes/1/ranges/2.json... done | ||
[node 1] writing range 3... converting to JSON... writing binary output: debug/nodes/1/ranges/3.json... done | ||
|
@@ -102,6 +102,8 @@ debug zip /dev/null --concurrency=1 --exclude-nodes=2 --cpu-profile-duration=0 | |
[node 1] writing range 35... converting to JSON... writing binary output: debug/nodes/1/ranges/35.json... done | ||
[node 1] writing range 36... converting to JSON... writing binary output: debug/nodes/1/ranges/36.json... done | ||
[node 1] writing range 37... converting to JSON... writing binary output: debug/nodes/1/ranges/37.json... done | ||
[node 1] writing range 38... converting to JSON... writing binary output: debug/nodes/1/ranges/38.json... done | ||
[node 1] writing range 39... converting to JSON... writing binary output: debug/nodes/1/ranges/39.json... done | ||
[node 2] skipping node... writing binary output: debug/nodes/2.skipped... done | ||
[node 3] node status... converting to JSON... writing binary output: debug/nodes/3/status.json... done | ||
[node 3] using SQL connection URL: postgresql://... | ||
|
@@ -138,7 +140,7 @@ debug zip /dev/null --concurrency=1 --exclude-nodes=2 --cpu-profile-duration=0 | |
[node 3] 1 log file ... | ||
[node 3] [log file ... | ||
[node 3] requesting ranges... received response... done | ||
[node 3] 37 ranges found | ||
[node 3] 39 ranges found | ||
[node 3] writing range 1... converting to JSON... writing binary output: debug/nodes/3/ranges/1.json... done | ||
[node 3] writing range 2... converting to JSON... writing binary output: debug/nodes/3/ranges/2.json... done | ||
[node 3] writing range 3... converting to JSON... writing binary output: debug/nodes/3/ranges/3.json... done | ||
|
@@ -176,6 +178,8 @@ debug zip /dev/null --concurrency=1 --exclude-nodes=2 --cpu-profile-duration=0 | |
[node 3] writing range 35... converting to JSON... writing binary output: debug/nodes/3/ranges/35.json... done | ||
[node 3] writing range 36... converting to JSON... writing binary output: debug/nodes/3/ranges/36.json... done | ||
[node 3] writing range 37... converting to JSON... writing binary output: debug/nodes/3/ranges/37.json... done | ||
[node 3] writing range 38... converting to JSON... writing binary output: debug/nodes/3/ranges/38.json... done | ||
[node 3] writing range 39... converting to JSON... writing binary output: debug/nodes/3/ranges/39.json... done | ||
[cluster] doctor examining cluster...... writing binary output: debug/reports/doctor.txt... done | ||
[cluster] requesting list of SQL databases... received response... done | ||
[cluster] 3 databases found | ||
|
@@ -184,7 +188,7 @@ debug zip /dev/null --concurrency=1 --exclude-nodes=2 --cpu-profile-duration=0 | |
[cluster] [database: postgres] requesting database details... received response... converting to JSON... writing binary output: debug/schema/[email protected]... done | ||
[cluster] [database: postgres] 0 tables found | ||
[cluster] [database: system] requesting database details... received response... converting to JSON... writing binary output: debug/schema/[email protected]... done | ||
[cluster] [database: system] 31 tables found | ||
[cluster] [database: system] 33 tables found | ||
[cluster] [database: system] [table: public.comments] requesting table details... received response... converting to JSON... writing binary output: debug/schema/system/public_comments.json... done | ||
[cluster] [database: system] [table: public.descriptor] requesting table details... received response... converting to JSON... writing binary output: debug/schema/system/public_descriptor.json... done | ||
[cluster] [database: system] [table: public.eventlog] requesting table details... received response... converting to JSON... writing binary output: debug/schema/system/public_eventlog.json... done | ||
|
@@ -206,6 +210,8 @@ debug zip /dev/null --concurrency=1 --exclude-nodes=2 --cpu-profile-duration=0 | |
[cluster] [database: system] [table: public.role_options] requesting table details... received response... converting to JSON... writing binary output: debug/schema/system/public_role_options.json... done | ||
[cluster] [database: system] [table: public.scheduled_jobs] requesting table details... received response... converting to JSON... writing binary output: debug/schema/system/public_scheduled_jobs.json... done | ||
[cluster] [database: system] [table: public.settings] requesting table details... received response... converting to JSON... writing binary output: debug/schema/system/public_settings.json... done | ||
[cluster] [database: system] [table: public.sql_statement_stats] requesting table details... received response... converting to JSON... writing binary output: debug/schema/system/public_sql_statement_stats.json... done | ||
[cluster] [database: system] [table: public.sql_transaction_stats] requesting table details... received response... converting to JSON... writing binary output: debug/schema/system/public_sql_transaction_stats.json... done | ||
[cluster] [database: system] [table: public.sqlliveness] requesting table details... received response... converting to JSON... writing binary output: debug/schema/system/public_sqlliveness.json... done | ||
[cluster] [database: system] [table: public.statement_bundle_chunks] requesting table details... received response... converting to JSON... writing binary output: debug/schema/system/public_statement_bundle_chunks.json... done | ||
[cluster] [database: system] [table: public.statement_diagnostics] requesting table details... received response... converting to JSON... writing binary output: debug/schema/system/public_statement_diagnostics.json... done | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,7 +64,7 @@ debug zip --concurrency=1 --cpu-profile-duration=0 /dev/null | |
[node 1] 1 log file ... | ||
[node 1] [log file ... | ||
[node 1] requesting ranges... received response... done | ||
[node 1] 37 ranges found | ||
[node 1] 39 ranges found | ||
[node 1] writing range 1... converting to JSON... writing binary output: debug/nodes/1/ranges/1.json... done | ||
[node 1] writing range 2... converting to JSON... writing binary output: debug/nodes/1/ranges/2.json... done | ||
[node 1] writing range 3... converting to JSON... writing binary output: debug/nodes/1/ranges/3.json... done | ||
|
@@ -102,6 +102,8 @@ debug zip --concurrency=1 --cpu-profile-duration=0 /dev/null | |
[node 1] writing range 35... converting to JSON... writing binary output: debug/nodes/1/ranges/35.json... done | ||
[node 1] writing range 36... converting to JSON... writing binary output: debug/nodes/1/ranges/36.json... done | ||
[node 1] writing range 37... converting to JSON... writing binary output: debug/nodes/1/ranges/37.json... done | ||
[node 1] writing range 38... converting to JSON... writing binary output: debug/nodes/1/ranges/38.json... done | ||
[node 1] writing range 39... converting to JSON... writing binary output: debug/nodes/1/ranges/39.json... done | ||
[node 3] node status... converting to JSON... writing binary output: debug/nodes/3/status.json... done | ||
[node 3] using SQL connection URL: postgresql://... | ||
[node 3] retrieving SQL data for crdb_internal.feature_usage... writing output: debug/nodes/3/crdb_internal.feature_usage.txt... done | ||
|
@@ -137,7 +139,7 @@ debug zip --concurrency=1 --cpu-profile-duration=0 /dev/null | |
[node 3] 1 log file ... | ||
[node 3] [log file ... | ||
[node 3] requesting ranges... received response... done | ||
[node 3] 37 ranges found | ||
[node 3] 39 ranges found | ||
[node 3] writing range 1... converting to JSON... writing binary output: debug/nodes/3/ranges/1.json... done | ||
[node 3] writing range 2... converting to JSON... writing binary output: debug/nodes/3/ranges/2.json... done | ||
[node 3] writing range 3... converting to JSON... writing binary output: debug/nodes/3/ranges/3.json... done | ||
|
@@ -175,6 +177,8 @@ debug zip --concurrency=1 --cpu-profile-duration=0 /dev/null | |
[node 3] writing range 35... converting to JSON... writing binary output: debug/nodes/3/ranges/35.json... done | ||
[node 3] writing range 36... converting to JSON... writing binary output: debug/nodes/3/ranges/36.json... done | ||
[node 3] writing range 37... converting to JSON... writing binary output: debug/nodes/3/ranges/37.json... done | ||
[node 3] writing range 38... converting to JSON... writing binary output: debug/nodes/3/ranges/38.json... done | ||
[node 3] writing range 39... converting to JSON... writing binary output: debug/nodes/3/ranges/39.json... done | ||
[cluster] doctor examining cluster...... writing binary output: debug/reports/doctor.txt... done | ||
[cluster] requesting list of SQL databases... received response... done | ||
[cluster] 3 databases found | ||
|
@@ -183,7 +187,7 @@ debug zip --concurrency=1 --cpu-profile-duration=0 /dev/null | |
[cluster] [database: postgres] requesting database details... received response... converting to JSON... writing binary output: debug/schema/[email protected]... done | ||
[cluster] [database: postgres] 0 tables found | ||
[cluster] [database: system] requesting database details... received response... converting to JSON... writing binary output: debug/schema/[email protected]... done | ||
[cluster] [database: system] 31 tables found | ||
[cluster] [database: system] 33 tables found | ||
[cluster] [database: system] [table: public.comments] requesting table details... received response... converting to JSON... writing binary output: debug/schema/system/public_comments.json... done | ||
[cluster] [database: system] [table: public.descriptor] requesting table details... received response... converting to JSON... writing binary output: debug/schema/system/public_descriptor.json... done | ||
[cluster] [database: system] [table: public.eventlog] requesting table details... received response... converting to JSON... writing binary output: debug/schema/system/public_eventlog.json... done | ||
|
@@ -205,6 +209,8 @@ debug zip --concurrency=1 --cpu-profile-duration=0 /dev/null | |
[cluster] [database: system] [table: public.role_options] requesting table details... received response... converting to JSON... writing binary output: debug/schema/system/public_role_options.json... done | ||
[cluster] [database: system] [table: public.scheduled_jobs] requesting table details... received response... converting to JSON... writing binary output: debug/schema/system/public_scheduled_jobs.json... done | ||
[cluster] [database: system] [table: public.settings] requesting table details... received response... converting to JSON... writing binary output: debug/schema/system/public_settings.json... done | ||
[cluster] [database: system] [table: public.sql_statement_stats] requesting table details... received response... converting to JSON... writing binary output: debug/schema/system/public_sql_statement_stats.json... done | ||
[cluster] [database: system] [table: public.sql_transaction_stats] requesting table details... received response... converting to JSON... writing binary output: debug/schema/system/public_sql_transaction_stats.json... done | ||
[cluster] [database: system] [table: public.sqlliveness] requesting table details... received response... converting to JSON... writing binary output: debug/schema/system/public_sqlliveness.json... done | ||
[cluster] [database: system] [table: public.statement_bundle_chunks] requesting table details... received response... converting to JSON... writing binary output: debug/schema/system/public_statement_bundle_chunks.json... done | ||
[cluster] [database: system] [table: public.statement_diagnostics] requesting table details... received response... converting to JSON... writing binary output: debug/schema/system/public_statement_diagnostics.json... done | ||
|
Oops, something went wrong.