From 81a866de8c42808a0205b04601659168cde1a672 Mon Sep 17 00:00:00 2001 From: maryliag Date: Sun, 19 Mar 2023 11:24:50 -0400 Subject: [PATCH 1/6] ui: add badges for filter elements Adds badges for each of the selected filters on SQL Activity and Insights pages. Part Of #98891 Release note (ui change): Adds badges for each selected filter on SQL Activity and Insights pages. --- .../schemaInsights/schemaInsightsView.tsx | 8 +- .../statementInsightsView.tsx | 8 +- .../transactionInsightsView.tsx | 8 +- .../src/queryFilter/filter.module.scss | 29 ++++ .../cluster-ui/src/queryFilter/filter.tsx | 160 +++++++++++++++--- .../src/queryFilter/filterClasses.ts | 10 ++ .../cluster-ui/src/sessions/sessionsPage.tsx | 7 +- .../statementsPage/statementsPage.module.scss | 5 + .../src/statementsPage/statementsPage.tsx | 17 +- .../src/tableStatistics/tableStatistics.tsx | 14 +- .../src/transactionsPage/transactionsPage.tsx | 17 +- 11 files changed, 231 insertions(+), 52 deletions(-) diff --git a/pkg/ui/workspaces/cluster-ui/src/insights/schemaInsights/schemaInsightsView.tsx b/pkg/ui/workspaces/cluster-ui/src/insights/schemaInsights/schemaInsightsView.tsx index 040bfa9b3b28..fd3c07d84ac9 100644 --- a/pkg/ui/workspaces/cluster-ui/src/insights/schemaInsights/schemaInsightsView.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/insights/schemaInsights/schemaInsightsView.tsx @@ -26,6 +26,7 @@ import { defaultFilters, Filter, getFullFiltersAsStringRecord, + SelectedFilters, } from "../../queryFilter"; import { queryByName, syncHistory } from "../../util"; import { getTableSortFromURL } from "../../sortedtable/getTableSortFromURL"; @@ -220,6 +221,12 @@ export const SchemaInsightsView: React.FC = ({ /> +
= ({ totalCount={filteredSchemaInsights?.length} arrayItemName="schema insights" activeFilters={countActiveFilters} - onClearFilters={clearFilters} />
= ({ /> +
= ({ totalCount={filteredStatements?.length} arrayItemName="statement insights" activeFilters={countActiveFilters} - onClearFilters={clearFilters} />
= ( /> +
= ( totalCount={filteredTransactions?.length} arrayItemName="transaction insights" activeFilters={countActiveFilters} - onClearFilters={clearFilters} />
> = { workloadInsightType: "", schemaInsightType: "", executionStatus: "", + username: "", }; -export const calculateActiveFilters = (filters: Filters): number => { - return Object.keys(inactiveFiltersState).reduce( - (active, filter: keyof Filters) => { - return filters[filter] != null && - inactiveFiltersState[filter] !== filters[filter] - ? (active += 1) - : active; - }, - 0, +const getActiveFilters = (filters: Filters): string[] => { + return Object.keys(inactiveFiltersState).filter( + filter => + filters[filter] != null && + inactiveFiltersState[filter] !== filters[filter], ); }; +export const calculateActiveFilters = (filters: Filters): number => { + return getActiveFilters(filters).length; +}; + export const getTimeValueInSeconds = (filters: Filters): number | "empty" => { if (filters.timeNumber === "0") return "empty"; switch (filters.timeUnit) { @@ -437,7 +440,7 @@ export class Filter extends React.Component { }); const appFilter = (
-
Application Name
+
{getLabelFromKey("app")}
{ }); const dbFilter = (
-
Database
+
{getLabelFromKey("database")}
{ }); const usernameFilter = (
-
User Name
+
{getLabelFromKey("username")}
{ }); const sessionStatusFilter = (
-
Session Status
+
+ {getLabelFromKey("sessionStatus")} +
{ ); const executionStatusFilter = (
-
Execution Status
+
+ {getLabelFromKey("executionStatus")} +
{ }); const schemaInsightTypeFilter = (
-
Schema Insight Type
+
+ {getLabelFromKey("schemaInsightType")} +
{ : []; const workloadInsightTypeValue = workloadInsightTypeOptions.filter( option => { - return filters.workloadInsightType.split(",").includes(option.label); + return filters.workloadInsightType?.split(",").includes(option.label); }, ); const workloadInsightTypeFilter = (
-
Workload Insight Type
+
+ {getLabelFromKey("workloadInsightType")} +
{ ); const regionsFilter = (
-
Region
+
{getLabelFromKey("regions")}
{ }); const nodesFilter = (
-
Node
+
{getLabelFromKey("nodes")}
{ }); const sqlTypeFilter = (
-
Statement Type
+
{getLabelFromKey("sqlType")}
{ ); } } + +interface SelectedFilterProps { + filters: Filters; + onRemoveFilter: (filters: Filters) => void; + onClearFilters: () => void; + className?: string; +} +export function SelectedFilters( + props: SelectedFilterProps, +): React.ReactElement { + const { filters, onRemoveFilter, onClearFilters, className } = props; + const activeFilters = getActiveFilters(filters); + const badges = activeFilters.map(filter => { + return ( + + ); + }); + + return ( +
+ {badges} + {activeFilters.length > 0 && ( + + )} +
+ ); +} + +function removeFilter( + filters: Filters, + filter: string, + onRemoveFilter: (filters: Filters) => void, +): void { + filters[filter] = inactiveFiltersState[filter]; + onRemoveFilter({ ...filters }); +} +interface FilterBadgeProps { + filters: Filters; + name: string; + values: string | boolean; + unit: string; + onRemoveFilter: (filters: Filters) => void; +} +function FilterBadge(props: FilterBadgeProps): React.ReactElement { + const { filters, name, values, onRemoveFilter } = props; + const unit = name === "timeNumber" ? props.unit : ""; + let value = `${getLabelFromKey(name)}: ${values.toString()} ${unit}`; + if (value.length > 100) { + value = value.substring(0, 100) + "..."; + } + return ( +
+ {value} + removeFilter(filters, name, onRemoveFilter)} + /> +
+ ); +} + +function getLabelFromKey(key: string): string { + switch (key) { + case "app": + return "Application Name"; + case "database": + return "Database"; + case "executionStatus": + return "Execution Status"; + case "fullScan": + return "Full Scan"; + case "nodes": + return "Node"; + case "regions": + return "Region"; + case "schemaInsightType": + return "Schema Insight Type"; + case "sessionStatus": + return "Session Status"; + case "sqlType": + return "Statement Type"; + case "timeNumber": + return "Runs Longer Than"; + case "username": + return "User Name"; + case "workloadInsightType": + return "Workload Insight Type"; + default: + return key; + } +} diff --git a/pkg/ui/workspaces/cluster-ui/src/queryFilter/filterClasses.ts b/pkg/ui/workspaces/cluster-ui/src/queryFilter/filterClasses.ts index d329d106a7a6..d027e2dd6a76 100644 --- a/pkg/ui/workspaces/cluster-ui/src/queryFilter/filterClasses.ts +++ b/pkg/ui/workspaces/cluster-ui/src/queryFilter/filterClasses.ts @@ -39,3 +39,13 @@ export const applyBtn = { wrapper: cx("apply-btn__wrapper"), btn: cx("apply-btn__btn"), }; + +export const clearBnt = { + btn: cx("clear-btn"), +}; + +export const badge = { + area: cx("badges-area"), + wrapper: cx("badge-wrapper"), + closeArea: cx("close-area"), +}; diff --git a/pkg/ui/workspaces/cluster-ui/src/sessions/sessionsPage.tsx b/pkg/ui/workspaces/cluster-ui/src/sessions/sessionsPage.tsx index 600ecf18335e..3fde145b7787 100644 --- a/pkg/ui/workspaces/cluster-ui/src/sessions/sessionsPage.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/sessions/sessionsPage.tsx @@ -37,6 +37,7 @@ import { Filters, getTimeValueInSeconds, handleFiltersFromQueryString, + SelectedFilters, } from "../queryFilter"; import TerminateQueryModal, { @@ -396,6 +397,11 @@ export class SessionsPage extends React.Component< filters={filters} timeLabel={"Session duration"} /> +
@@ -410,7 +416,6 @@ export class SessionsPage extends React.Component< totalCount={sessionsToDisplay.length} arrayItemName="sessions" activeFilters={activeFilters} - onClearFilters={this.onClearFilters} />
diff --git a/pkg/ui/workspaces/cluster-ui/src/statementsPage/statementsPage.module.scss b/pkg/ui/workspaces/cluster-ui/src/statementsPage/statementsPage.module.scss index 26c85c3de3b8..b9bb3991d0c8 100644 --- a/pkg/ui/workspaces/cluster-ui/src/statementsPage/statementsPage.module.scss +++ b/pkg/ui/workspaces/cluster-ui/src/statementsPage/statementsPage.module.scss @@ -123,3 +123,8 @@ cl-table-container { .margin-top { margin-top: 20px; } + +.margin-adjusted { + margin-top: 5px; + margin-bottom: -15px; +} diff --git a/pkg/ui/workspaces/cluster-ui/src/statementsPage/statementsPage.tsx b/pkg/ui/workspaces/cluster-ui/src/statementsPage/statementsPage.tsx index 96c393310317..91f4ce6ab278 100644 --- a/pkg/ui/workspaces/cluster-ui/src/statementsPage/statementsPage.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/statementsPage/statementsPage.tsx @@ -28,6 +28,7 @@ import { Filter, Filters, handleFiltersFromQueryString, + SelectedFilters, updateFiltersQueryParamsOnTab, } from "../queryFilter"; @@ -553,16 +554,6 @@ export class StatementsPage extends React.Component< ); const period = timeScaleToString(this.props.timeScale); - const clearFilter = activeFilters ? ( - - - - ) : ( - <> - ); - const sortSettingLabel = getSortLabel(this.props.reqSortSetting); return ( @@ -601,7 +592,6 @@ export class StatementsPage extends React.Component< onSubmitColumns={onColumnsChange} /> - {clearFilter} @@ -625,6 +615,11 @@ export class StatementsPage extends React.Component<
+ = ({ ); + const clearBtn = ( + <> + |   + + + ); + const resultsCountAndClear = ( <> {totalCount} {totalCount === 1 ? "result" : "results"} {period && periodLabel} -    |   - +    {onClearFilters && clearBtn} ); diff --git a/pkg/ui/workspaces/cluster-ui/src/transactionsPage/transactionsPage.tsx b/pkg/ui/workspaces/cluster-ui/src/transactionsPage/transactionsPage.tsx index 8adb048972d3..683cf90321a8 100644 --- a/pkg/ui/workspaces/cluster-ui/src/transactionsPage/transactionsPage.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/transactionsPage/transactionsPage.tsx @@ -47,6 +47,7 @@ import { defaultFilters, handleFiltersFromQueryString, updateFiltersQueryParamsOnTab, + SelectedFilters, } from "../queryFilter"; import { UIConfigState } from "../store"; import { @@ -486,16 +487,6 @@ export class TransactionsPage extends React.Component< ); const period = timeScaleToString(this.props.timeScale); - const clearFilter = activeFilters ? ( - - - - ) : ( - <> - ); - const sortSettingLabel = getSortLabel(this.props.reqSortSetting); return ( <> @@ -530,7 +521,6 @@ export class TransactionsPage extends React.Component< onSubmitColumns={onColumnsChange} /> - {clearFilter} @@ -554,6 +544,11 @@ export class TransactionsPage extends React.Component<
+ Date: Fri, 17 Mar 2023 14:59:04 -0400 Subject: [PATCH 2/6] sql: support array-flatten subqueries within UDFs Array-flatten subqueries (e.g., `ARRAY(SELECT a FROM t)`) are now supported within UDFs. They are now converted to a normal subquery with a ScalarGroupBy if they exist within a UDF, even if they are uncorrelated. This allows them to be executed without any changes to the execbuilder or the evaluation logic of `tree.Routine`. Fixes #98738 Release note: None --- pkg/sql/logictest/testdata/logic_test/udf | 28 ++++++++++-- pkg/sql/opt/exec/execbuilder/scalar.go | 14 ++++-- .../opt/exec/execbuilder/testdata/subquery | 7 +++ pkg/sql/opt/exec/execbuilder/testdata/udf | 24 ++++++++++ pkg/sql/opt/norm/rules/scalar.opt | 17 +++---- pkg/sql/opt/norm/scalar_funcs.go | 6 +++ pkg/sql/opt/norm/testdata/rules/scalar | 44 +++++++++++++++++++ pkg/sql/opt/ops/scalar.opt | 4 ++ pkg/sql/opt/optbuilder/scalar.go | 1 + pkg/sql/opt/xform/testdata/rules/cycle | 2 +- 10 files changed, 130 insertions(+), 17 deletions(-) diff --git a/pkg/sql/logictest/testdata/logic_test/udf b/pkg/sql/logictest/testdata/logic_test/udf index 449c1479f660..0fb6cf4ff742 100644 --- a/pkg/sql/logictest/testdata/logic_test/udf +++ b/pkg/sql/logictest/testdata/logic_test/udf @@ -2945,6 +2945,26 @@ SELECT all_fn(1), all_fn(2), all_fn(NULL::INT) NULL false NULL +subtest array_flatten + +statement ok +CREATE FUNCTION arr(x INT) RETURNS INT[] LANGUAGE SQL AS $$ + SELECT ARRAY(VALUES (1), (2), (x)); +$$ + +query T +SELECT arr(10) +---- +{1,2,10} + +query T +SELECT arr(i) FROM generate_series(1, 3) g(i) +---- +{1,2,1} +{1,2,2} +{1,2,3} + + subtest variadic # Variadic UDFS are not currently supported. @@ -3054,10 +3074,10 @@ SELECT oid, proname, pronamespace, proowner, prolang, proleakproof, proisstrict, FROM pg_catalog.pg_proc WHERE proname IN ('f_93314', 'f_93314_alias', 'f_93314_comp', 'f_93314_comp_t') ORDER BY oid; ---- -100271 f_93314 105 1546506610 14 false false false v 0 100270 · {} NULL SELECT i, e FROM test.public.t_93314 ORDER BY i LIMIT 1; -100273 f_93314_alias 105 1546506610 14 false false false v 0 100272 · {} NULL SELECT i, e FROM test.public.t_93314_alias ORDER BY i LIMIT 1; -100277 f_93314_comp 105 1546506610 14 false false false v 0 100274 · {} NULL SELECT (1, 2); -100278 f_93314_comp_t 105 1546506610 14 false false false v 0 100276 · {} NULL SELECT a, c FROM test.public.t_93314_comp LIMIT 1; +100272 f_93314 105 1546506610 14 false false false v 0 100271 · {} NULL SELECT i, e FROM test.public.t_93314 ORDER BY i LIMIT 1; +100274 f_93314_alias 105 1546506610 14 false false false v 0 100273 · {} NULL SELECT i, e FROM test.public.t_93314_alias ORDER BY i LIMIT 1; +100278 f_93314_comp 105 1546506610 14 false false false v 0 100275 · {} NULL SELECT (1, 2); +100279 f_93314_comp_t 105 1546506610 14 false false false v 0 100277 · {} NULL SELECT a, c FROM test.public.t_93314_comp LIMIT 1; # Regression test for #95240. Strict UDFs that are inlined should result in NULL # when presented with NULL arguments. diff --git a/pkg/sql/opt/exec/execbuilder/scalar.go b/pkg/sql/opt/exec/execbuilder/scalar.go index dab23683ba2e..e7a04d612575 100644 --- a/pkg/sql/opt/exec/execbuilder/scalar.go +++ b/pkg/sql/opt/exec/execbuilder/scalar.go @@ -495,6 +495,16 @@ func (b *Builder) buildArrayFlatten( panic(errors.AssertionFailedf("input to ArrayFlatten should be uncorrelated")) } + if b.planLazySubqueries { + // The NormalizeArrayFlattenToAgg rule should have converted an + // ArrayFlatten within a UDF into an aggregation. + // We don't yet convert an ArrayFlatten within a correlated subquery + // into an aggregation, so we return a decorrelation error. + // TODO(mgartner): Build an ArrayFlatten within a correlated subquery as + // a Routine, or apply NormalizeArrayFlattenToAgg to all ArrayFlattens. + return nil, b.decorrelationError() + } + root, err := b.buildRelational(af.Input) if err != nil { return nil, err @@ -762,10 +772,6 @@ func (b *Builder) buildSubquery( // because we don't need to optimize the subquery input any further. // It's already been fully optimized because it is uncorrelated and has // no outer columns. - // - // TODO(mgartner): Uncorrelated subqueries only need to be evaluated - // once. We should cache their result to avoid all this overhead for - // every invocation. inputRowCount := int64(input.Relational().Statistics().RowCountIfAvailable()) withExprs := make([]builtWithExpr, len(b.withExprs)) copy(withExprs, b.withExprs) diff --git a/pkg/sql/opt/exec/execbuilder/testdata/subquery b/pkg/sql/opt/exec/execbuilder/testdata/subquery index 9673591b71cb..6acffc7c9805 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/subquery +++ b/pkg/sql/opt/exec/execbuilder/testdata/subquery @@ -562,3 +562,10 @@ vectorized: true estimated row count: 1,000 (missing stats) table: corr@corr_pkey spans: FULL SCAN + +# Case where a correlated subquery contains an uncorrelated array-flatten +# subquery. +statement error could not decorrelate subquery +SELECT + CASE WHEN k < 5 THEN (SELECT array(SELECT 1) FROM corr tmp WHERE k*10 = corr.k) END +FROM corr diff --git a/pkg/sql/opt/exec/execbuilder/testdata/udf b/pkg/sql/opt/exec/execbuilder/testdata/udf index e33456450b96..71ac848d8b33 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/udf +++ b/pkg/sql/opt/exec/execbuilder/testdata/udf @@ -235,6 +235,30 @@ SELECT sub_fn4() FROM generate_series(1, 3) 1 1 +statement ok +CREATE FUNCTION arr() RETURNS INT[] LANGUAGE SQL AS $$ + SELECT ARRAY(VALUES (1), (2)); +$$ + +# A query with a uncorrelated array-flatten within a UDF. +query T +EXPLAIN (VERBOSE) SELECT arr() FROM generate_series(1, 3) +---- +distribution: local +vectorized: true +· +• render +│ columns: (arr) +│ render arr: arr() +│ +└── • project set + │ columns: (generate_series) + │ estimated row count: 10 + │ render 0: generate_series(1, 3) + │ + └── • emptyrow + columns: () + subtest regressions diff --git a/pkg/sql/opt/norm/rules/scalar.opt b/pkg/sql/opt/norm/rules/scalar.opt index 6e9866c3d0ed..0ee1943db443 100644 --- a/pkg/sql/opt/norm/rules/scalar.opt +++ b/pkg/sql/opt/norm/rules/scalar.opt @@ -383,15 +383,16 @@ $input # an aggregation). So it's desirable to perform this conversion in the # interest of decorrelation. # -# So the outcome is that we can perform uncorrelated ARRAY(...)s over any datatype, -# and correlated ones only over the types that array_agg supports. +# So the outcome is that we can perform uncorrelated ARRAY(...)s over any +# datatype, and correlated ones only over the types that array_agg supports. # # Note that optbuilder should have already verified that if the input is -# correlated, then we can array_agg over the input type. Also note that the -# Max1Row operator we introduce is guaranteed to be eliminated as -# MakeArrayAggForFlatten will return a ScalarGroupBy. +# correlated, then we can array_agg over the input type. [NormalizeArrayFlattenToAgg, Normalize] -(ArrayFlatten $input:(HasOuterCols $input) $subquery:*) +(ArrayFlatten + $input:* + $private:* & (CanNormalizeArrayFlatten $input $private) +) => (Coalesce [ @@ -403,7 +404,7 @@ $input (ArrayAgg (Variable $requestedCol:(SubqueryRequestedCol - $subquery + $private ) ) ) @@ -414,7 +415,7 @@ $input ] (MakeGrouping (MakeEmptyColSet) - (SubqueryOrdering $subquery) + (SubqueryOrdering $private) ) ) (MakeUnorderedSubquery) diff --git a/pkg/sql/opt/norm/scalar_funcs.go b/pkg/sql/opt/norm/scalar_funcs.go index 2fc808f78586..cd7125b659c3 100644 --- a/pkg/sql/opt/norm/scalar_funcs.go +++ b/pkg/sql/opt/norm/scalar_funcs.go @@ -387,3 +387,9 @@ func (c *CustomFuncs) SplitTupleEq(lhs, rhs *memo.TupleExpr) memo.FiltersExpr { } return res } + +// CanNormalizeArrayFlatten returns true if the input is correlated or if the +// ArrayFlatten exists within a UDF. +func (c *CustomFuncs) CanNormalizeArrayFlatten(input memo.RelExpr, p *memo.SubqueryPrivate) bool { + return c.HasOuterCols(input) || p.WithinUDF +} diff --git a/pkg/sql/opt/norm/testdata/rules/scalar b/pkg/sql/opt/norm/testdata/rules/scalar index 0bb77892c381..8d710fe008a8 100644 --- a/pkg/sql/opt/norm/testdata/rules/scalar +++ b/pkg/sql/opt/norm/testdata/rules/scalar @@ -1985,6 +1985,50 @@ project ├── columns: k:8!null └── key: (8) +exec-ddl +CREATE FUNCTION arr() RETURNS INT[] LANGUAGE SQL AS $$ + SELECT ARRAY(VALUES (1), (2)); +$$ +---- + +# Should trigger for uncorrelated ArrayFlatten subqueries within a UDF +norm expect=NormalizeArrayFlattenToAgg format=show-scalars +SELECT arr() +---- +values + ├── columns: arr:4 + ├── cardinality: [1 - 1] + ├── volatile + ├── key: () + ├── fd: ()-->(4) + └── tuple + └── udf: arr + └── body + └── values + ├── columns: array:3 + ├── cardinality: [1 - 1] + ├── key: () + ├── fd: ()-->(3) + └── tuple + └── coalesce + ├── subquery + │ └── scalar-group-by + │ ├── columns: array_agg:2 + │ ├── cardinality: [1 - 1] + │ ├── key: () + │ ├── fd: ()-->(2) + │ ├── values + │ │ ├── columns: column1:1!null + │ │ ├── cardinality: [2 - 2] + │ │ ├── tuple + │ │ │ └── const: 1 + │ │ └── tuple + │ │ └── const: 2 + │ └── aggregations + │ └── array-agg [as=array_agg:2, outer=(1)] + │ └── variable: column1:1 + └── const: ARRAY[] + exec-ddl CREATE TABLE pg_class ( oid OID NULL, diff --git a/pkg/sql/opt/ops/scalar.opt b/pkg/sql/opt/ops/scalar.opt index 1082cf049046..eb39882cee14 100644 --- a/pkg/sql/opt/ops/scalar.opt +++ b/pkg/sql/opt/ops/scalar.opt @@ -43,6 +43,10 @@ define SubqueryPrivate { # will eventually be output. It is only used for ArrayFlatten expressions. RequestedCol ColumnID + # WithinUDF is set to true if the subquery exists inside a UDFExpr. It is + # only used for ArrayFlatten expressions. + WithinUDF bool + # Cmp is only used for AnyOp. Cmp Operator diff --git a/pkg/sql/opt/optbuilder/scalar.go b/pkg/sql/opt/optbuilder/scalar.go index fc4187303d9d..4b89264e1621 100644 --- a/pkg/sql/opt/optbuilder/scalar.go +++ b/pkg/sql/opt/optbuilder/scalar.go @@ -169,6 +169,7 @@ func (b *Builder) buildScalar( OriginalExpr: s.Subquery, Ordering: s.ordering, RequestedCol: inCol, + WithinUDF: b.insideUDF, } out = b.factory.ConstructArrayFlatten(s.node, &subqueryPrivate) diff --git a/pkg/sql/opt/xform/testdata/rules/cycle b/pkg/sql/opt/xform/testdata/rules/cycle index b6ad54a309af..52441712f243 100644 --- a/pkg/sql/opt/xform/testdata/rules/cycle +++ b/pkg/sql/opt/xform/testdata/rules/cycle @@ -106,7 +106,7 @@ memo (not optimized, ~6KB, required=[], cycle=[G1->G4->G6->G9->G10->G12->G13->G1 ├── G7: (variable v) ├── G8: (const 1) ├── G9: (scalar-list G10 G11) - ├── G10: (subquery G12 &{ 0 unknown false}) + ├── G10: (subquery G12 &{ 0 false unknown false}) ├── G11: (false) ├── G12: (project G13 G14) ├── G13: (limit G1 G8) From 65cfe37e06fa26b2e9caae48cc1b4e06b1705886 Mon Sep 17 00:00:00 2001 From: Pavel Kalinnikov Date: Tue, 21 Mar 2023 14:09:27 +0000 Subject: [PATCH 3/6] kvserver: mark in-flight storage checkpoints This commit makes it so that the consistency checker checkpoints are first created in a "_pending" folder, and only after completion are atomically renamed to the intended directory name. This is to help distinguish valid checkpoints from the ones that weren't finalized (for example, when the node crashed in the meantime). Part of #81819 Epic: none Release note (ops change): checkpoint directories (that can be created in the rare event of range inconsistency) are now clearly indicated as pending until they are fully populated. This is to help operators to distinguish valid checkpoints from corrupted ones. --- pkg/kv/kvserver/consistency_queue_test.go | 8 +++++++- pkg/kv/kvserver/replica_consistency.go | 4 ++++ pkg/kv/kvserver/store.go | 9 ++++++++- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/pkg/kv/kvserver/consistency_queue_test.go b/pkg/kv/kvserver/consistency_queue_test.go index 877ca26ab01a..d793f9598df6 100644 --- a/pkg/kv/kvserver/consistency_queue_test.go +++ b/pkg/kv/kvserver/consistency_queue_test.go @@ -17,6 +17,7 @@ import ( "math/rand" "path/filepath" "strconv" + "strings" "testing" "time" @@ -373,6 +374,10 @@ func TestCheckConsistencyInconsistent(t *testing.T) { for i := 0; i < numStores; i++ { cps := onDiskCheckpointPaths(i) require.Len(t, cps, 1) + t.Logf("found a checkpoint at %s", cps[0]) + // The checkpoint must have been finalized. + require.False(t, strings.HasSuffix(cps[0], "_pending")) + metric := tc.GetFirstStoreFromServer(t, i).Metrics().RdbCheckpoints testutils.SucceedsSoon(t, func() error { if got, want := metric.Value(), int64(1); got != want { @@ -387,7 +392,8 @@ func TestCheckConsistencyInconsistent(t *testing.T) { require.NoError(t, err) // Copy the min-version file so we can open the checkpoint as a store. require.NoError(t, vfs.Copy(fs, storage.MinVersionFilename, fs.PathJoin(cps[0], storage.MinVersionFilename))) - cpEng := storage.InMemFromFS(context.Background(), fs, cps[0], cluster.MakeClusterSettings(), storage.CacheSize(1<<20)) + cpEng := storage.InMemFromFS(context.Background(), fs, cps[0], cluster.MakeClusterSettings(), + storage.ForTesting, storage.MustExist, storage.ReadOnly, storage.CacheSize(1<<20)) defer cpEng.Close() // Find the problematic range in the storage. diff --git a/pkg/kv/kvserver/replica_consistency.go b/pkg/kv/kvserver/replica_consistency.go index d21fc5bd4482..d4f4c9ad103b 100644 --- a/pkg/kv/kvserver/replica_consistency.go +++ b/pkg/kv/kvserver/replica_consistency.go @@ -777,6 +777,10 @@ To inspect the checkpoints, one can use the cockroach debug range-data tool, and command line tools like diff. For example: $ cockroach debug range-data --replicated data/auxiliary/checkpoints/rN_at_M N + +Note that a directory that ends with "_pending" might not represent a valid +checkpoint. Such directories can exist if the node fails during checkpoint +creation. These directories should be deleted, or inspected with caution. ` attentionArgs := []any{r, desc.Replicas(), redact.Safe(auxDir), redact.Safe(path)} preventStartupMsg := fmt.Sprintf(attentionFmt, attentionArgs...) diff --git a/pkg/kv/kvserver/store.go b/pkg/kv/kvserver/store.go index 1e6daced47e2..d84cac13427c 100644 --- a/pkg/kv/kvserver/store.go +++ b/pkg/kv/kvserver/store.go @@ -3070,8 +3070,15 @@ func (s *Store) checkpointSpans(desc *roachpb.RangeDescriptor) []roachpb.Span { func (s *Store) checkpoint(tag string, spans []roachpb.Span) (string, error) { checkpointBase := s.checkpointsDir() _ = s.TODOEngine().MkdirAll(checkpointBase) + // Create the checkpoint in a "pending" directory first. If we fail midway, it + // should be clear that the directory contains an incomplete checkpoint. + pendingDir := filepath.Join(checkpointBase, tag+"_pending") + if err := s.TODOEngine().CreateCheckpoint(pendingDir, spans); err != nil { + return "", err + } + // Atomically rename the directory when it represents a complete checkpoint. checkpointDir := filepath.Join(checkpointBase, tag) - if err := s.TODOEngine().CreateCheckpoint(checkpointDir, spans); err != nil { + if err := s.TODOEngine().Rename(pendingDir, checkpointDir); err != nil { return "", err } return checkpointDir, nil From 0c693186970fabc4af8dd3308a367f03aacf4b64 Mon Sep 17 00:00:00 2001 From: Alex Barganier Date: Mon, 20 Mar 2023 15:56:45 -0400 Subject: [PATCH 4/6] pkg/ccl: Unskip TestTenantStatusAPI/tenant_ranges/pagination Fixes: https://github.com/cockroachdb/cockroach/issues/92979 Previously, in https://github.com/cockroachdb/cockroach/pull/97386, we skipped test_tenant_ranges_pagination because it was marked as flaky. The test makes a request for a single range and expects an offset of `1` back. It then uses this offset to request a second range, and expects an offset of `2`. This means that the test requires at least 3 ranges to exist on the tenant. The test was flaking on the assertion that the offset returned by the second request came back as `2`. Instead, it was flaking when the offset came back as `0`, which signifies that there are no more ranges to process. We learned that the tenant create process has an asycnhronous splitting of ranges that occurs, which is what would lead to this sporadic scenario where not enough ranges existed (yet) for the test to succeed. This patch updates the test with a `testutils.SucceedsSoon` clause that checks first that `crdb_internal.ranges` contains at least 3 ranges, prior to making the second request. This should provide sufficient time for the range split queue to be processed and eliminate the vast majority of these test flakes. Release note: none --- .../serverccl/statusccl/tenant_status_test.go | 40 +++++++++++++------ 1 file changed, 27 insertions(+), 13 deletions(-) diff --git a/pkg/ccl/serverccl/statusccl/tenant_status_test.go b/pkg/ccl/serverccl/statusccl/tenant_status_test.go index 7a7b6dfa5886..631206c1dafd 100644 --- a/pkg/ccl/serverccl/statusccl/tenant_status_test.go +++ b/pkg/ccl/serverccl/statusccl/tenant_status_test.go @@ -1290,8 +1290,6 @@ func testTenantRangesRPC(_ context.Context, t *testing.T, helper serverccl.Tenan }) t.Run("test tenant ranges pagination", func(t *testing.T) { - skip.WithIssue(t, 92979, - "flaky test, difficult to reproduce locally. Skip until resolved.") ctx := context.Background() resp1, err := tenantA.TenantRanges(ctx, &serverpb.TenantRangesRequest{ Limit: 1, @@ -1302,18 +1300,34 @@ func testTenantRangesRPC(_ context.Context, t *testing.T, helper serverccl.Tenan require.Len(t, ranges.Ranges, 1) } - resp2, err := tenantA.TenantRanges(ctx, &serverpb.TenantRangesRequest{ - Limit: 1, - Offset: resp1.Next, + sql := helper.TestCluster().TenantConn(0) + // Wait for the split queue to process some before requesting the 2nd range. + // We expect an offset for the 3rd range, so wait until at least 3 ranges exist. + testutils.SucceedsSoon(t, func() error { + res := sql.QueryStr(t, "SELECT count(*) FROM crdb_internal.ranges") + require.Equal(t, len(res), 1) + require.Equal(t, len(res[0]), 1) + rangeCount, err := strconv.Atoi(res[0][0]) + require.NoError(t, err) + if rangeCount < 3 { + return errors.Newf("expected >= 3 ranges, got %d", rangeCount) + } + + resp2, err := tenantA.TenantRanges(ctx, &serverpb.TenantRangesRequest{ + Limit: 1, + Offset: resp1.Next, + }) + require.NoError(t, err) + require.Equal(t, 2, int(resp2.Next)) + for locality, ranges := range resp2.RangesByLocality { + require.Len(t, ranges.Ranges, 1) + // Verify pagination functions based on ascending RangeID order. + require.True(t, + resp1.RangesByLocality[locality].Ranges[0].RangeID < ranges.Ranges[0].RangeID) + } + return nil }) - require.NoError(t, err) - require.Equal(t, 2, int(resp2.Next)) - for locality, ranges := range resp2.RangesByLocality { - require.Len(t, ranges.Ranges, 1) - // Verify pagination functions based on ascending RangeID order. - require.True(t, - resp1.RangesByLocality[locality].Ranges[0].RangeID < ranges.Ranges[0].RangeID) - } + }) } From b6d5bb730ced72ad8f4a9c0b5e7b4ad10879a9f3 Mon Sep 17 00:00:00 2001 From: Eric Harmeling Date: Wed, 15 Mar 2023 17:23:54 +0000 Subject: [PATCH 5/6] sql: added indexes to system.statement_statistics, system.transaction_statistics Fixes #98624. This commit adds indexes on new computed columns to the system.statement_statistics and system.transaction_statistics tables. Epic: none Release note: None --- .../settings/settings-for-tenants.txt | 2 +- docs/generated/settings/settings.html | 2 +- pkg/cli/testdata/declarative-rules/deprules | 2 +- pkg/cli/testdata/declarative-rules/oprules | 2 +- pkg/clusterversion/cockroach_versions.go | 10 + pkg/sql/catalog/bootstrap/testdata/testdata | 12 +- pkg/sql/catalog/systemschema/system.go | 264 ++++++++++++- .../systemschema_test/testdata/bootstrap | 32 +- .../testdata/logic_test/crdb_internal_catalog | 4 +- .../testdata/logic_test/information_schema | 10 + .../logictest/testdata/logic_test/pg_catalog | 40 ++ .../testdata/sql_statistics_persisted | 369 ++++++++++++++++++ .../sqlstats/persistedsqlstats/BUILD.bazel | 1 + .../sqlstats/persistedsqlstats/bench_test.go | 233 +++++++++++ pkg/upgrade/upgrades/BUILD.bazel | 2 + .../create_computed_indexes_sql_statistics.go | 274 +++++++++++++ ...te_computed_indexes_sql_statistics_test.go | 99 +++++ pkg/upgrade/upgrades/upgrades.go | 6 + 18 files changed, 1339 insertions(+), 25 deletions(-) create mode 100644 pkg/upgrade/upgrades/create_computed_indexes_sql_statistics.go create mode 100644 pkg/upgrade/upgrades/create_computed_indexes_sql_statistics_test.go diff --git a/docs/generated/settings/settings-for-tenants.txt b/docs/generated/settings/settings-for-tenants.txt index 40ee3c481a31..a054d383c6f6 100644 --- a/docs/generated/settings/settings-for-tenants.txt +++ b/docs/generated/settings/settings-for-tenants.txt @@ -289,4 +289,4 @@ trace.opentelemetry.collector string address of an OpenTelemetry trace collecto trace.snapshot.rate duration 0s if non-zero, interval at which background trace snapshots are captured trace.span_registry.enabled boolean true if set, ongoing traces can be seen at https:///#/debug/tracez trace.zipkin.collector string the address of a Zipkin instance to receive traces, as :. If no port is specified, 9411 will be used. -version version 1000022.2-90 set the active cluster version in the format '.' +version version 1000022.2-92 set the active cluster version in the format '.' diff --git a/docs/generated/settings/settings.html b/docs/generated/settings/settings.html index 48d06500dc6f..346164370455 100644 --- a/docs/generated/settings/settings.html +++ b/docs/generated/settings/settings.html @@ -241,6 +241,6 @@
trace.snapshot.rate
duration0sif non-zero, interval at which background trace snapshots are captured
trace.span_registry.enabled
booleantrueif set, ongoing traces can be seen at https://<ui>/#/debug/tracez
trace.zipkin.collector
stringthe address of a Zipkin instance to receive traces, as <host>:<port>. If no port is specified, 9411 will be used. -
version
version1000022.2-90set the active cluster version in the format '<major>.<minor>' +
version
version1000022.2-92set the active cluster version in the format '<major>.<minor>' diff --git a/pkg/cli/testdata/declarative-rules/deprules b/pkg/cli/testdata/declarative-rules/deprules index 30ea992a37c9..ddba96b9f4ba 100644 --- a/pkg/cli/testdata/declarative-rules/deprules +++ b/pkg/cli/testdata/declarative-rules/deprules @@ -1,6 +1,6 @@ dep ---- -debug declarative-print-rules 1000022.2-90 dep +debug declarative-print-rules 1000022.2-92 dep deprules ---- - name: 'CheckConstraint transitions to ABSENT uphold 2-version invariant: PUBLIC->VALIDATED' diff --git a/pkg/cli/testdata/declarative-rules/oprules b/pkg/cli/testdata/declarative-rules/oprules index f947541bd949..b17895b375d9 100644 --- a/pkg/cli/testdata/declarative-rules/oprules +++ b/pkg/cli/testdata/declarative-rules/oprules @@ -1,6 +1,6 @@ op ---- -debug declarative-print-rules 1000022.2-90 op +debug declarative-print-rules 1000022.2-92 op rules ---- [] diff --git a/pkg/clusterversion/cockroach_versions.go b/pkg/clusterversion/cockroach_versions.go index 4ece0b7fbf84..ab20f8685f43 100644 --- a/pkg/clusterversion/cockroach_versions.go +++ b/pkg/clusterversion/cockroach_versions.go @@ -498,6 +498,12 @@ const ( // config runner persistent job has been created. V23_1_CreateAutoConfigRunnerJob + // V23_1AddSQLStatsComputedIndexes is the version at which Cockroach adds new + // computed columns and indexes to the statement_statistics and + // transaction_statistics system tables. These columns optimize persisted SQL + // statistics queries for observability. + V23_1AddSQLStatsComputedIndexes + // ************************************************* // Step (1): Add new versions here. // Do not add new versions to a patch release. @@ -863,6 +869,10 @@ var rawVersionsSingleton = keyedVersions{ Key: V23_1_CreateAutoConfigRunnerJob, Version: roachpb.Version{Major: 22, Minor: 2, Internal: 90}, }, + { + Key: V23_1AddSQLStatsComputedIndexes, + Version: roachpb.Version{Major: 22, Minor: 2, Internal: 92}, + }, // ************************************************* // Step (2): Add new versions here. diff --git a/pkg/sql/catalog/bootstrap/testdata/testdata b/pkg/sql/catalog/bootstrap/testdata/testdata index c91638a71bd9..ce894221cfc4 100644 --- a/pkg/sql/catalog/bootstrap/testdata/testdata +++ b/pkg/sql/catalog/bootstrap/testdata/testdata @@ -1,4 +1,4 @@ -system hash=159f64e9e22191f7cd10a02f210a035ad7dd6171d53c7a1c6a1700d5eabe4476 +system hash=79e458c6140c33646de91ec455e3168e6bc99b485441d51d8f2f0c32ce99c0e1 ---- [{"key":"04646573632d696467656e","value":"01c801"} ,{"key":"8b"} @@ -34,8 +34,8 @@ system hash=159f64e9e22191f7cd10a02f210a035ad7dd6171d53c7a1c6a1700d5eabe4476 ,{"key":"8b89af8a89","value":"030ad3030a0b73716c6c6976656e6573731827200128013a00422f0a0a73657373696f6e5f696410011a0c0808100018003000501160002000300068007000780080010088010098010042300a0a65787069726174696f6e10021a0d080310001800300050a40d60002000300068007000780080010088010098010042300a0b637264625f726567696f6e10031a0c0808100018003000501160002000300068007000780080010088010098010048045280010a077072696d61727910021801220b637264625f726567696f6e220a73657373696f6e5f69642a0a65787069726174696f6e30033001400040004a10080010001a00200028003000380040005a0070027a0408002000800100880100900104980101a20106080012001800a80100b20100ba0100c00100c80100d00101e0010060036a250a0d0a0561646d696e10e00318e0030a0c0a04726f6f7410e00318e00312046e6f64651802800101880103980100b201380a077072696d61727910001a0b637264625f726567696f6e1a0a73657373696f6e5f69641a0a65787069726174696f6e2003200120022802b80101c20100e80100f2010408001200f801008002009202009a0200b20200b80200c0021dc80200e00200800300880302a80300b00300"} ,{"key":"8b89b08a89","value":"030ac0040a0a6d6967726174696f6e731828200128013a00422a0a056d616a6f7210011a0c08011040180030005014600020003000680070007800800100880100980100422a0a056d696e6f7210021a0c08011040180030005014600020003000680070007800800100880100980100422a0a05706174636810031a0c08011040180030005014600020003000680070007800800100880100980100422d0a08696e7465726e616c10041a0c0801104018003000501460002000300068007000780080010088010098010042320a0c636f6d706c657465645f617410051a0d080910001800300050a00960002000300068007000780080010088010098010048065290010a077072696d6172791001180122056d616a6f7222056d696e6f72220570617463682208696e7465726e616c2a0c636f6d706c657465645f6174300130023003300440004000400040004a10080010001a00200028003000380040005a0070057a0408002000800100880100900104980101a20106080012001800a80100b20100ba0100c00100c80100d00101e0010060026a250a0d0a0561646d696e10e00318e0030a0c0a04726f6f7410e00318e00312046e6f64651802800101880103980100b201440a077072696d61727910001a056d616a6f721a056d696e6f721a0570617463681a08696e7465726e616c1a0c636f6d706c657465645f6174200120022003200420052805b80101c20100e80100f2010408001200f801008002009202009a0200b20200b80200c0021dc80200e00200800300880302a80300b00300"} ,{"key":"8b89b18a89","value":"030aaa030a0b6a6f696e5f746f6b656e731829200128013a0042280a02696410011a0d080e100018003000508617600020003000680070007800800100880100980100422b0a0673656372657410021a0c0808100018003000501160002000300068007000780080010088010098010042300a0a65787069726174696f6e10031a0d080910001800300050a009600020003000680070007800800100880100980100480452710a077072696d61727910011801220269642a067365637265742a0a65787069726174696f6e300140004a10080010001a00200028003000380040005a00700270037a0408002000800100880100900104980101a20106080012001800a80100b20100ba0100c00100c80100d00101e0010060026a250a0d0a0561646d696e10e00318e0030a0c0a04726f6f7410e00318e00312046e6f64651802800101880103980100b2012b0a077072696d61727910001a0269641a067365637265741a0a65787069726174696f6e2001200220032800b80101c20100e80100f2010408001200f801008002009202009a0200b20200b80200c0021dc80200e00200800300880302a80300b00300"} -,{"key":"8b89b28a89","value":"030abe140a1473746174656d656e745f73746174697374696373182a200128013a0042330a0d616767726567617465645f747310011a0d080910001800300050a00960002000300068007000780080010088010098010042330a0e66696e6765727072696e745f696410021a0c08081000180030005011600020003000680070007800800100880100980100423f0a1a7472616e73616374696f6e5f66696e6765727072696e745f696410031a0c08081000180030005011600020003000680070007800800100880100980100422e0a09706c616e5f6861736810041a0c08081000180030005011600020003000680070007800800100880100980100422d0a086170705f6e616d6510051a0c08071000180030005019600020003000680070007800800100880100980100422c0a076e6f64655f696410061a0c0801104018003000501460002000300068007000780080010088010098010042380a0c6167675f696e74657276616c10071a13080610001800300050a20960006a040800100020003000680070007800800100880100980100422e0a086d6574616461746110081a0d081210001800300050da1d60002000300068007000780080010088010098010042300a0a7374617469737469637310091a0d081210001800300050da1d600020003000680070007800800100880100980100422a0a04706c616e100a1a0d081210001800300050da1d600020003000680070007800800100880100980100429c020a68637264625f696e7465726e616c5f616767726567617465645f74735f6170705f6e616d655f66696e6765727072696e745f69645f6e6f64655f69645f706c616e5f686173685f7472616e73616374696f6e5f66696e6765727072696e745f69645f73686172645f38100b1a0c080110201800300050176000200030015a8c016d6f6428666e76333228637264625f696e7465726e616c2e646174756d735f746f5f627974657328616767726567617465645f74732c206170705f6e616d652c2066696e6765727072696e745f69642c206e6f64655f69642c20706c616e5f686173682c207472616e73616374696f6e5f66696e6765727072696e745f696429292c20383a3a3a494e543829680070007800800100880100980100425f0a15696e6465785f7265636f6d6d656e646174696f6e73100c1a1d080f100018003000380750f1075a0c080710001800300050196000600020002a1241525241595b5d3a3a3a535452494e475b5d3000680070007800800100880100980100426c0a0d696e64657865735f7573616765100d1a0d081210001800300050da1d6000200130005a3728737461746973746963732d3e2773746174697374696373273a3a3a535452494e47292d3e27696e6465786573273a3a3a535452494e47680070007800800101880100980100480e52bd040a077072696d617279100118012268637264625f696e7465726e616c5f616767726567617465645f74735f6170705f6e616d655f66696e6765727072696e745f69645f6e6f64655f69645f706c616e5f686173685f7472616e73616374696f6e5f66696e6765727072696e745f69645f73686172645f38220d616767726567617465645f7473220e66696e6765727072696e745f6964221a7472616e73616374696f6e5f66696e6765727072696e745f69642209706c616e5f6861736822086170705f6e616d6522076e6f64655f69642a0c6167675f696e74657276616c2a086d657461646174612a0a737461746973746963732a04706c616e2a15696e6465785f7265636f6d6d656e646174696f6e73300b30013002300330043005300640004000400040004000400040004a10080010001a00200028003000380040005a00700770087009700a700c7a0408002000800100880100900104980101a201c70108011268637264625f696e7465726e616c5f616767726567617465645f74735f6170705f6e616d655f66696e6765727072696e745f69645f6e6f64655f69645f706c616e5f686173685f7472616e73616374696f6e5f66696e6765727072696e745f69645f73686172645f381808220d616767726567617465645f747322086170705f6e616d65220e66696e6765727072696e745f696422076e6f64655f69642209706c616e5f68617368221a7472616e73616374696f6e5f66696e6765727072696e745f6964a80100b20100ba0100c00100c80100d00101e001005a9d010a1566696e6765727072696e745f73746174735f69647810021800220e66696e6765727072696e745f6964221a7472616e73616374696f6e5f66696e6765727072696e745f696430023003380b3801380438053806400040004a10080010001a00200028003000380040005a007a0408002000800100880100900103980100a20106080012001800a80100b20100ba0100c00100c80100d00100e001005a7f0a11696e64657865735f75736167655f69647810031800220d696e64657865735f7573616765300d380b38013802380338043805380640004a10080010001a00200028003000380040005a007a0408002000800101880100900103980100a20106080012001800a80100b20100ba0100c00100c80100d00100d80100e0010060046a210a0b0a0561646d696e102018200a0a0a04726f6f741020182012046e6f64651802800101880103980100a201b9020abc01637264625f696e7465726e616c5f616767726567617465645f74735f6170705f6e616d655f66696e6765727072696e745f69645f6e6f64655f69645f706c616e5f686173685f7472616e73616374696f6e5f66696e6765727072696e745f69645f73686172645f3820494e2028303a3a3a494e54382c20313a3a3a494e54382c20323a3a3a494e54382c20333a3a3a494e54382c20343a3a3a494e54382c20353a3a3a494e54382c20363a3a3a494e54382c20373a3a3a494e543829126e636865636b5f637264625f696e7465726e616c5f616767726567617465645f74735f6170705f6e616d655f66696e6765727072696e745f69645f6e6f64655f69645f706c616e5f686173685f7472616e73616374696f6e5f66696e6765727072696e745f69645f73686172645f381800280b300038014002b201a9020a077072696d61727910001a68637264625f696e7465726e616c5f616767726567617465645f74735f6170705f6e616d655f66696e6765727072696e745f69645f6e6f64655f69645f706c616e5f686173685f7472616e73616374696f6e5f66696e6765727072696e745f69645f73686172645f381a0d616767726567617465645f74731a0e66696e6765727072696e745f69641a1a7472616e73616374696f6e5f66696e6765727072696e745f69641a09706c616e5f686173681a086170705f6e616d651a076e6f64655f69641a0c6167675f696e74657276616c1a086d657461646174611a0a737461746973746963731a04706c616e1a15696e6465785f7265636f6d6d656e646174696f6e73200b200120022003200420052006200720082009200a200c2800b80101c20100e80100f2010408001200f801008002009202009a0200b20200b80200c0021dc80200e00200800300880303a80300b00300"} -,{"key":"8b89b38a89","value":"030ae60c0a167472616e73616374696f6e5f73746174697374696373182b200128013a0042330a0d616767726567617465645f747310011a0d080910001800300050a00960002000300068007000780080010088010098010042330a0e66696e6765727072696e745f696410021a0c08081000180030005011600020003000680070007800800100880100980100422d0a086170705f6e616d6510031a0c08071000180030005019600020003000680070007800800100880100980100422c0a076e6f64655f696410041a0c0801104018003000501460002000300068007000780080010088010098010042380a0c6167675f696e74657276616c10051a13080610001800300050a20960006a040800100020003000680070007800800100880100980100422e0a086d6574616461746110061a0d081210001800300050da1d60002000300068007000780080010088010098010042300a0a7374617469737469637310071a0d081210001800300050da1d60002000300068007000780080010088010098010042cf010a43637264625f696e7465726e616c5f616767726567617465645f74735f6170705f6e616d655f66696e6765727072696e745f69645f6e6f64655f69645f73686172645f3810081a0c080110201800300050176000200030015a656d6f6428666e76333228637264625f696e7465726e616c2e646174756d735f746f5f627974657328616767726567617465645f74732c206170705f6e616d652c2066696e6765727072696e745f69642c206e6f64655f696429292c20383a3a3a494e543829680070007800800100880100980100480952fb020a077072696d617279100118012243637264625f696e7465726e616c5f616767726567617465645f74735f6170705f6e616d655f66696e6765727072696e745f69645f6e6f64655f69645f73686172645f38220d616767726567617465645f7473220e66696e6765727072696e745f696422086170705f6e616d6522076e6f64655f69642a0c6167675f696e74657276616c2a086d657461646174612a0a7374617469737469637330083001300230033004400040004000400040004a10080010001a00200028003000380040005a007005700670077a0408002000800100880100900104980101a2017b08011243637264625f696e7465726e616c5f616767726567617465645f74735f6170705f6e616d655f66696e6765727072696e745f69645f6e6f64655f69645f73686172645f381808220d616767726567617465645f747322086170705f6e616d65220e66696e6765727072696e745f696422076e6f64655f6964a80100b20100ba0100c00100c80100d00101e001005a7b0a1566696e6765727072696e745f73746174735f69647810021800220e66696e6765727072696e745f69643002380838013803380440004a10080010001a00200028003000380040005a007a0408002000800100880100900103980100a20106080012001800a80100b20100ba0100c00100c80100d00100e0010060036a210a0b0a0561646d696e102018200a0a0a04726f6f741020182012046e6f64651802800101880103980100a201ef010a9701637264625f696e7465726e616c5f616767726567617465645f74735f6170705f6e616d655f66696e6765727072696e745f69645f6e6f64655f69645f73686172645f3820494e2028303a3a3a494e54382c20313a3a3a494e54382c20323a3a3a494e54382c20333a3a3a494e54382c20343a3a3a494e54382c20353a3a3a494e54382c20363a3a3a494e54382c20373a3a3a494e5438291249636865636b5f637264625f696e7465726e616c5f616767726567617465645f74735f6170705f6e616d655f66696e6765727072696e745f69645f6e6f64655f69645f73686172645f3818002808300038014002b201b8010a077072696d61727910001a43637264625f696e7465726e616c5f616767726567617465645f74735f6170705f6e616d655f66696e6765727072696e745f69645f6e6f64655f69645f73686172645f381a0d616767726567617465645f74731a0e66696e6765727072696e745f69641a086170705f6e616d651a076e6f64655f69641a0c6167675f696e74657276616c1a086d657461646174611a0a73746174697374696373200820012002200320042005200620072800b80101c20100e80100f2010408001200f801008002009202009a0200b20200b80200c0021dc80200e00200800300880303a80300b00300"} +,{"key":"8b89b28a89","value":"030ab7240a1473746174656d656e745f73746174697374696373182a200128013a0042330a0d616767726567617465645f747310011a0d080910001800300050a00960002000300068007000780080010088010098010042330a0e66696e6765727072696e745f696410021a0c08081000180030005011600020003000680070007800800100880100980100423f0a1a7472616e73616374696f6e5f66696e6765727072696e745f696410031a0c08081000180030005011600020003000680070007800800100880100980100422e0a09706c616e5f6861736810041a0c08081000180030005011600020003000680070007800800100880100980100422d0a086170705f6e616d6510051a0c08071000180030005019600020003000680070007800800100880100980100422c0a076e6f64655f696410061a0c0801104018003000501460002000300068007000780080010088010098010042380a0c6167675f696e74657276616c10071a13080610001800300050a20960006a040800100020003000680070007800800100880100980100422e0a086d6574616461746110081a0d081210001800300050da1d60002000300068007000780080010088010098010042300a0a7374617469737469637310091a0d081210001800300050da1d600020003000680070007800800100880100980100422a0a04706c616e100a1a0d081210001800300050da1d600020003000680070007800800100880100980100429c020a68637264625f696e7465726e616c5f616767726567617465645f74735f6170705f6e616d655f66696e6765727072696e745f69645f6e6f64655f69645f706c616e5f686173685f7472616e73616374696f6e5f66696e6765727072696e745f69645f73686172645f38100b1a0c080110201800300050176000200030015a8c016d6f6428666e76333228637264625f696e7465726e616c2e646174756d735f746f5f627974657328616767726567617465645f74732c206170705f6e616d652c2066696e6765727072696e745f69642c206e6f64655f69642c20706c616e5f686173682c207472616e73616374696f6e5f66696e6765727072696e745f696429292c20383a3a3a494e543829680070007800800100880100980100425f0a15696e6465785f7265636f6d6d656e646174696f6e73100c1a1d080f100018003000380750f1075a0c080710001800300050196000600020002a1241525241595b5d3a3a3a535452494e475b5d3000680070007800800100880100980100426c0a0d696e64657865735f7573616765100d1a0d081210001800300050da1d6000200130005a3728737461746973746963732d3e2773746174697374696373273a3a3a535452494e47292d3e27696e6465786573273a3a3a535452494e4768007000780080010188010098010042710a0f657865637574696f6e5f636f756e74100e1a0c080110401800300050146000200130005a3b2828737461746973746963732d3e2773746174697374696373273a3a3a535452494e47292d3e27636e74273a3a3a535452494e47293a3a494e5438680070007800800100880100980100428a010a0f736572766963655f6c6174656e6379100f1a0d080210401800300050bd056000200130005a53282828737461746973746963732d3e2773746174697374696373273a3a3a535452494e47292d3e277376634c6174273a3a3a535452494e47292d3e276d65616e273a3a3a535452494e47293a3a464c4f4154386800700078008001008801009801004297010a0d6370755f73716c5f6e616e6f7310101a0d080210401800300050bd056000200130005a62282828737461746973746963732d3e27657865637574696f6e5f73746174697374696373273a3a3a535452494e47292d3e2763707553514c4e616e6f73273a3a3a535452494e47292d3e276d65616e273a3a3a535452494e47293a3a464c4f415438680070007800800100880100980100429c010a0f636f6e74656e74696f6e5f74696d6510111a0d080210401800300050bd056000200130005a65282828737461746973746963732d3e27657865637574696f6e5f73746174697374696373273a3a3a535452494e47292d3e27636f6e74656e74696f6e54696d65273a3a3a535452494e47292d3e276d65616e273a3a3a535452494e47293a3a464c4f41543868007000780080010088010098010042db010a1e746f74616c5f657374696d617465645f657865637574696f6e5f74696d6510121a0d080210401800300050bd056000200130005a94012828737461746973746963732d3e2773746174697374696373273a3a3a535452494e47292d3e27636e74273a3a3a535452494e47293a3a464c4f415438202a20282828737461746973746963732d3e2773746174697374696373273a3a3a535452494e47292d3e277376634c6174273a3a3a535452494e47292d3e3e276d65616e273a3a3a535452494e47293a3a464c4f415438680070007800800100880100980100481352a9050a077072696d617279100118012268637264625f696e7465726e616c5f616767726567617465645f74735f6170705f6e616d655f66696e6765727072696e745f69645f6e6f64655f69645f706c616e5f686173685f7472616e73616374696f6e5f66696e6765727072696e745f69645f73686172645f38220d616767726567617465645f7473220e66696e6765727072696e745f6964221a7472616e73616374696f6e5f66696e6765727072696e745f69642209706c616e5f6861736822086170705f6e616d6522076e6f64655f69642a0c6167675f696e74657276616c2a086d657461646174612a0a737461746973746963732a04706c616e2a15696e6465785f7265636f6d6d656e646174696f6e732a0f657865637574696f6e5f636f756e742a0f736572766963655f6c6174656e63792a0d6370755f73716c5f6e616e6f732a0f636f6e74656e74696f6e5f74696d652a1e746f74616c5f657374696d617465645f657865637574696f6e5f74696d65300b30013002300330043005300640004000400040004000400040004a10080010001a00200028003000380040005a00700770087009700a700c700e700f7010701170127a0408002000800100880100900104980101a201c70108011268637264625f696e7465726e616c5f616767726567617465645f74735f6170705f6e616d655f66696e6765727072696e745f69645f6e6f64655f69645f706c616e5f686173685f7472616e73616374696f6e5f66696e6765727072696e745f69645f73686172645f381808220d616767726567617465645f747322086170705f6e616d65220e66696e6765727072696e745f696422076e6f64655f69642209706c616e5f68617368221a7472616e73616374696f6e5f66696e6765727072696e745f6964a80100b20100ba0100c00100c80100d00101e001005a9d010a1566696e6765727072696e745f73746174735f69647810021800220e66696e6765727072696e745f6964221a7472616e73616374696f6e5f66696e6765727072696e745f696430023003380b3801380438053806400040004a10080010001a00200028003000380040005a007a0408002000800100880100900103980100a20106080012001800a80100b20100ba0100c00100c80100d00100e001005a7f0a11696e64657865735f75736167655f69647810031800220d696e64657865735f7573616765300d380b38013802380338043805380640004a10080010001a00200028003000380040005a007a0408002000800101880100900103980100a20106080012001800a80100b20100ba0100c00100c80100d00100d80100e001005ac5010a13657865637574696f6e5f636f756e745f69647810041800220d616767726567617465645f747322086170705f6e616d65220f657865637574696f6e5f636f756e7430013005300e380b38023803380438064000400040014a10080010001a00200028003000380040005a007a0408002000800100880100900103980100a20106080012001800a80100b20100ba01286170705f6e616d65204e4f54204c494b4520272420696e7465726e616c25273a3a3a535452494e47c00100c80100d00100e001005ac7010a13736572766963655f6c6174656e63795f69647810051800220d616767726567617465645f747322086170705f6e616d65220f736572766963655f6c6174656e637930013005300f380b38023803380438064000400040014a10080010001a00200028003000380040005a00680f7a0408002000800100880100900103980100a20106080012001800a80100b20100ba01286170705f6e616d65204e4f54204c494b4520272420696e7465726e616c25273a3a3a535452494e47c00100c80100d00100e001005ac3010a116370755f73716c5f6e616e6f735f69647810061800220d616767726567617465645f747322086170705f6e616d65220d6370755f73716c5f6e616e6f73300130053010380b38023803380438064000400040014a10080010001a00200028003000380040005a0068107a0408002000800100880100900103980100a20106080012001800a80100b20100ba01286170705f6e616d65204e4f54204c494b4520272420696e7465726e616c25273a3a3a535452494e47c00100c80100d00100e001005ac7010a13636f6e74656e74696f6e5f74696d655f69647810071800220d616767726567617465645f747322086170705f6e616d65220f636f6e74656e74696f6e5f74696d65300130053011380b38023803380438064000400040014a10080010001a00200028003000380040005a0068117a0408002000800100880100900103980100a20106080012001800a80100b20100ba01286170705f6e616d65204e4f54204c494b4520272420696e7465726e616c25273a3a3a535452494e47c00100c80100d00100e001005ae5010a22746f74616c5f657374696d617465645f657865637574696f6e5f74696d655f69647810081800220d616767726567617465645f747322086170705f6e616d65221e746f74616c5f657374696d617465645f657865637574696f6e5f74696d65300130053012380b38023803380438064000400040014a10080010001a00200028003000380040005a0068127a0408002000800100880100900103980100a20106080012001800a80100b20100ba01286170705f6e616d65204e4f54204c494b4520272420696e7465726e616c25273a3a3a535452494e47c00100c80100d00100e0010060096a210a0b0a0561646d696e102018200a0a0a04726f6f741020182012046e6f64651802800101880103980100a201b9020abc01637264625f696e7465726e616c5f616767726567617465645f74735f6170705f6e616d655f66696e6765727072696e745f69645f6e6f64655f69645f706c616e5f686173685f7472616e73616374696f6e5f66696e6765727072696e745f69645f73686172645f3820494e2028303a3a3a494e54382c20313a3a3a494e54382c20323a3a3a494e54382c20333a3a3a494e54382c20343a3a3a494e54382c20353a3a3a494e54382c20363a3a3a494e54382c20373a3a3a494e543829126e636865636b5f637264625f696e7465726e616c5f616767726567617465645f74735f6170705f6e616d655f66696e6765727072696e745f69645f6e6f64655f69645f706c616e5f686173685f7472616e73616374696f6e5f66696e6765727072696e745f69645f73686172645f381800280b300038014002b20195030a077072696d61727910001a68637264625f696e7465726e616c5f616767726567617465645f74735f6170705f6e616d655f66696e6765727072696e745f69645f6e6f64655f69645f706c616e5f686173685f7472616e73616374696f6e5f66696e6765727072696e745f69645f73686172645f381a0d616767726567617465645f74731a0e66696e6765727072696e745f69641a1a7472616e73616374696f6e5f66696e6765727072696e745f69641a09706c616e5f686173681a086170705f6e616d651a076e6f64655f69641a0c6167675f696e74657276616c1a086d657461646174611a0a737461746973746963731a04706c616e1a15696e6465785f7265636f6d6d656e646174696f6e731a0f657865637574696f6e5f636f756e741a0f736572766963655f6c6174656e63791a0d6370755f73716c5f6e616e6f731a0f636f6e74656e74696f6e5f74696d651a1e746f74616c5f657374696d617465645f657865637574696f6e5f74696d65200b200120022003200420052006200720082009200a200c200e200f2010201120122800b80101c20100e80100f2010408001200f801008002009202009a0200b20200b80200c0021dc80200e00200800300880303a80300b00300"} +,{"key":"8b89b38a89","value":"030acb1c0a167472616e73616374696f6e5f73746174697374696373182b200128013a0042330a0d616767726567617465645f747310011a0d080910001800300050a00960002000300068007000780080010088010098010042330a0e66696e6765727072696e745f696410021a0c08081000180030005011600020003000680070007800800100880100980100422d0a086170705f6e616d6510031a0c08071000180030005019600020003000680070007800800100880100980100422c0a076e6f64655f696410041a0c0801104018003000501460002000300068007000780080010088010098010042380a0c6167675f696e74657276616c10051a13080610001800300050a20960006a040800100020003000680070007800800100880100980100422e0a086d6574616461746110061a0d081210001800300050da1d60002000300068007000780080010088010098010042300a0a7374617469737469637310071a0d081210001800300050da1d60002000300068007000780080010088010098010042cf010a43637264625f696e7465726e616c5f616767726567617465645f74735f6170705f6e616d655f66696e6765727072696e745f69645f6e6f64655f69645f73686172645f3810081a0c080110201800300050176000200030015a656d6f6428666e76333228637264625f696e7465726e616c2e646174756d735f746f5f627974657328616767726567617465645f74732c206170705f6e616d652c2066696e6765727072696e745f69642c206e6f64655f696429292c20383a3a3a494e54382968007000780080010088010098010042710a0f657865637574696f6e5f636f756e7410091a0c080110401800300050146000200130005a3b2828737461746973746963732d3e2773746174697374696373273a3a3a535452494e47292d3e27636e74273a3a3a535452494e47293a3a494e5438680070007800800100880100980100428a010a0f736572766963655f6c6174656e6379100a1a0d080210401800300050bd056000200130005a53282828737461746973746963732d3e2773746174697374696373273a3a3a535452494e47292d3e277376634c6174273a3a3a535452494e47292d3e276d65616e273a3a3a535452494e47293a3a464c4f4154386800700078008001008801009801004297010a0d6370755f73716c5f6e616e6f73100b1a0d080210401800300050bd056000200130005a62282828737461746973746963732d3e27657865637574696f6e5f73746174697374696373273a3a3a535452494e47292d3e2763707553514c4e616e6f73273a3a3a535452494e47292d3e276d65616e273a3a3a535452494e47293a3a464c4f415438680070007800800100880100980100429c010a0f636f6e74656e74696f6e5f74696d65100c1a0d080210401800300050bd056000200130005a65282828737461746973746963732d3e27657865637574696f6e5f73746174697374696373273a3a3a535452494e47292d3e27636f6e74656e74696f6e54696d65273a3a3a535452494e47292d3e276d65616e273a3a3a535452494e47293a3a464c4f41543868007000780080010088010098010042db010a1e746f74616c5f657374696d617465645f657865637574696f6e5f74696d65100d1a0d080210401800300050bd056000200130005a94012828737461746973746963732d3e2773746174697374696373273a3a3a535452494e47292d3e27636e74273a3a3a535452494e47293a3a464c4f415438202a20282828737461746973746963732d3e2773746174697374696373273a3a3a535452494e47292d3e277376634c6174273a3a3a535452494e47292d3e3e276d65616e273a3a3a535452494e47293a3a464c4f415438680070007800800100880100980100480e52e7030a077072696d617279100118012243637264625f696e7465726e616c5f616767726567617465645f74735f6170705f6e616d655f66696e6765727072696e745f69645f6e6f64655f69645f73686172645f38220d616767726567617465645f7473220e66696e6765727072696e745f696422086170705f6e616d6522076e6f64655f69642a0c6167675f696e74657276616c2a086d657461646174612a0a737461746973746963732a0f657865637574696f6e5f636f756e742a0f736572766963655f6c6174656e63792a0d6370755f73716c5f6e616e6f732a0f636f6e74656e74696f6e5f74696d652a1e746f74616c5f657374696d617465645f657865637574696f6e5f74696d6530083001300230033004400040004000400040004a10080010001a00200028003000380040005a007005700670077009700a700b700c700d7a0408002000800100880100900104980101a2017b08011243637264625f696e7465726e616c5f616767726567617465645f74735f6170705f6e616d655f66696e6765727072696e745f69645f6e6f64655f69645f73686172645f381808220d616767726567617465645f747322086170705f6e616d65220e66696e6765727072696e745f696422076e6f64655f6964a80100b20100ba0100c00100c80100d00101e001005a7b0a1566696e6765727072696e745f73746174735f69647810021800220e66696e6765727072696e745f69643002380838013803380440004a10080010001a00200028003000380040005a007a0408002000800100880100900103980100a20106080012001800a80100b20100ba0100c00100c80100d00100e001005ac1010a13657865637574696f6e5f636f756e745f69647810031800220d616767726567617465645f747322086170705f6e616d65220f657865637574696f6e5f636f756e743001300330093808380238044000400040014a10080010001a00200028003000380040005a007a0408002000800100880100900103980100a20106080012001800a80100b20100ba01286170705f6e616d65204e4f54204c494b4520272420696e7465726e616c25273a3a3a535452494e47c00100c80100d00100e001005ac3010a13736572766963655f6c6174656e63795f69647810041800220d616767726567617465645f747322086170705f6e616d65220f736572766963655f6c6174656e637930013003300a3808380238044000400040014a10080010001a00200028003000380040005a00680a7a0408002000800100880100900103980100a20106080012001800a80100b20100ba01286170705f6e616d65204e4f54204c494b4520272420696e7465726e616c25273a3a3a535452494e47c00100c80100d00100e001005abf010a116370755f73716c5f6e616e6f735f69647810051800220d616767726567617465645f747322086170705f6e616d65220d6370755f73716c5f6e616e6f7330013003300b3808380238044000400040014a10080010001a00200028003000380040005a00680b7a0408002000800100880100900103980100a20106080012001800a80100b20100ba01286170705f6e616d65204e4f54204c494b4520272420696e7465726e616c25273a3a3a535452494e47c00100c80100d00100e001005ac3010a13636f6e74656e74696f6e5f74696d655f69647810061800220d616767726567617465645f747322086170705f6e616d65220f636f6e74656e74696f6e5f74696d6530013003300c3808380238044000400040014a10080010001a00200028003000380040005a00680c7a0408002000800100880100900103980100a20106080012001800a80100b20100ba01286170705f6e616d65204e4f54204c494b4520272420696e7465726e616c25273a3a3a535452494e47c00100c80100d00100e001005ae1010a22746f74616c5f657374696d617465645f657865637574696f6e5f74696d655f69647810071800220d616767726567617465645f747322086170705f6e616d65221e746f74616c5f657374696d617465645f657865637574696f6e5f74696d6530013003300d3808380238044000400040014a10080010001a00200028003000380040005a00680d7a0408002000800100880100900103980100a20106080012001800a80100b20100ba01286170705f6e616d65204e4f54204c494b4520272420696e7465726e616c25273a3a3a535452494e47c00100c80100d00100e0010060086a210a0b0a0561646d696e102018200a0a0a04726f6f741020182012046e6f64651802800101880103980100a201ef010a9701637264625f696e7465726e616c5f616767726567617465645f74735f6170705f6e616d655f66696e6765727072696e745f69645f6e6f64655f69645f73686172645f3820494e2028303a3a3a494e54382c20313a3a3a494e54382c20323a3a3a494e54382c20333a3a3a494e54382c20343a3a3a494e54382c20353a3a3a494e54382c20363a3a3a494e54382c20373a3a3a494e5438291249636865636b5f637264625f696e7465726e616c5f616767726567617465645f74735f6170705f6e616d655f66696e6765727072696e745f69645f6e6f64655f69645f73686172645f3818002808300038014002b201a4020a077072696d61727910001a43637264625f696e7465726e616c5f616767726567617465645f74735f6170705f6e616d655f66696e6765727072696e745f69645f6e6f64655f69645f73686172645f381a0d616767726567617465645f74731a0e66696e6765727072696e745f69641a086170705f6e616d651a076e6f64655f69641a0c6167675f696e74657276616c1a086d657461646174611a0a737461746973746963731a0f657865637574696f6e5f636f756e741a0f736572766963655f6c6174656e63791a0d6370755f73716c5f6e616e6f731a0f636f6e74656e74696f6e5f74696d651a1e746f74616c5f657374696d617465645f657865637574696f6e5f74696d65200820012002200320042005200620072009200a200b200c200d2800b80101c20100e80100f2010408001200f801008002009202009a0200b20200b80200c0021dc80200e00200800300880303a80300b00300"} ,{"key":"8b89b48a89","value":"030ad0050a1664617461626173655f726f6c655f73657474696e6773182c200128013a0042300a0b64617461626173655f696410011a0c080c100018003000501a600020003000680070007800800100880100980100422e0a09726f6c655f6e616d6510021a0c08071000180030005019600020003000680070007800800100880100980100423e0a0873657474696e677310031a1d080f100018003000380750f1075a0c080710001800300050196000600020003000680070007800800100880100980100422c0a07726f6c655f696410041a0c080c100018003000501a60002000300068007000780080010088010098010048055288010a077072696d61727910011801220b64617461626173655f69642209726f6c655f6e616d652a0873657474696e67732a07726f6c655f696430013002400040004a10080010001a00200028003000380040005a00700370047a0408002000800100880100900104980101a20106080012001800a80100b20100ba0100c00100c80100d00102e001005aa4010a2e64617461626173655f726f6c655f73657474696e67735f64617461626173655f69645f726f6c655f69645f6b657910021801220b64617461626173655f69642207726f6c655f69642a0873657474696e6773300130043802400040004a10080010001a00200028003000380040005a0070037a0408002000800100880100900103980100a20106080012001800a80100b20100ba0100c00100c80100d00101e0010060036a250a0d0a0561646d696e10e00318e0030a0c0a04726f6f7410e00318e00312046e6f64651802800101880103980100b201400a077072696d61727910001a0b64617461626173655f69641a09726f6c655f6e616d651a0873657474696e67731a07726f6c655f696420012002200320042800b80101c20100e80100f2010408001200f801008002009202009a0200b20200b80200c0021dc80200e00200800300880303a80300b00300"} ,{"key":"8b89b58a89","value":"030a840a0a0c74656e616e745f7573616765182d200128013a00422e0a0974656e616e745f696410011a0c0801104018003000501460002000300068007000780080010088010098010042300a0b696e7374616e63655f696410021a0c0801104018003000501460002000300068007000780080010088010098010042350a106e6578745f696e7374616e63655f696410031a0c0801104018003000501460002000300068007000780080010088010098010042310a0b6c6173745f75706461746510041a0d080510001800300050da0860002000300068007000780080010088010098010042340a0e72755f62757273745f6c696d697410051a0d080210401800300050bd0560002001300068007000780080010088010098010042340a0e72755f726566696c6c5f7261746510061a0d080210401800300050bd0560002001300068007000780080010088010098010042300a0a72755f63757272656e7410071a0d080210401800300050bd0560002001300068007000780080010088010098010042370a1163757272656e745f73686172655f73756d10081a0d080210401800300050bd0560002001300068007000780080010088010098010042360a11746f74616c5f636f6e73756d7074696f6e10091a0c0808100018003000501160002001300068007000780080010088010098010042330a0e696e7374616e63655f6c65617365100a1a0c0808100018003000501160002001300068007000780080010088010098010042310a0c696e7374616e63655f736571100b1a0c0801104018003000501460002001300068007000780080010088010098010042350a0f696e7374616e63655f736861726573100c1a0d080210401800300050bd05600020013000680070007800800100880100980100480d52a5020a077072696d61727910011801220974656e616e745f6964220b696e7374616e63655f69642a106e6578745f696e7374616e63655f69642a0b6c6173745f7570646174652a0e72755f62757273745f6c696d69742a0e72755f726566696c6c5f726174652a0a72755f63757272656e742a1163757272656e745f73686172655f73756d2a11746f74616c5f636f6e73756d7074696f6e2a0e696e7374616e63655f6c656173652a0c696e7374616e63655f7365712a0f696e7374616e63655f73686172657330013002400040004a10080010001a00200028003000380040005a007003700470057006700770087009700a700b700c7a0408002000800100880100900104980101a20106080012001800a80100b20100ba0100c00100c80100d00101e0010060026a250a0d0a0561646d696e10e00318e0030a0c0a04726f6f7410e00318e00312046e6f64651802800101880103980100b201dd010a077072696d61727910001a0974656e616e745f69641a0b696e7374616e63655f69641a106e6578745f696e7374616e63655f69641a0b6c6173745f7570646174651a0e72755f62757273745f6c696d69741a0e72755f726566696c6c5f726174651a0a72755f63757272656e741a1163757272656e745f73686172655f73756d1a11746f74616c5f636f6e73756d7074696f6e1a0e696e7374616e63655f6c656173651a0c696e7374616e63655f7365711a0f696e7374616e63655f736861726573200120022003200420052006200720082009200a200b200c2800b80101c20100e80100f2010408001200f801008002009202009a0200b20200b80200c0021dc80200e00200800300880302a80300b00300"} ,{"key":"8b89b68a89","value":"030adf050a0d73716c5f696e7374616e636573182e200128013a0042270a02696410011a0c0801104018003000501460002000300068007000780080010088010098010042290a046164647210021a0c08071000180030005019600020013000680070007800800100880100980100422f0a0a73657373696f6e5f696410031a0c08081000180030005011600020013000680070007800800100880100980100422e0a086c6f63616c69747910041a0d081210001800300050da1d600020013000680070007800800100880100980100422d0a0873716c5f6164647210051a0c0807100018003000501960002001300068007000780080010088010098010042300a0b637264625f726567696f6e10061a0c0808100018003000501160002000300068007000780080010088010098010042330a0e62696e6172795f76657273696f6e10071a0c08071000180030005019600020013000680070007800800100880100980100480852aa010a077072696d61727910021801220b637264625f726567696f6e220269642a04616464722a0a73657373696f6e5f69642a086c6f63616c6974792a0873716c5f616464722a0e62696e6172795f76657273696f6e30063001400040004a10080010001a00200028003000380040005a00700270037004700570077a0408002000800100880100900104980101a20106080012001800a80100b20100ba0100c00100c80100d00101e0010060036a250a0d0a0561646d696e10e00318e0030a0c0a04726f6f7410e00318e00312046e6f64651802800101880103980100b201620a077072696d61727910001a0269641a04616464721a0a73657373696f6e5f69641a086c6f63616c6974791a0873716c5f616464721a0b637264625f726567696f6e1a0e62696e6172795f76657273696f6e20012002200320042005200620072800b80101c20100e80100f2010408001200f801008002009202009a0200b20200b80200c0021dc80200e00200800300880302a80300b00300"} @@ -169,7 +169,7 @@ system hash=159f64e9e22191f7cd10a02f210a035ad7dd6171d53c7a1c6a1700d5eabe4476 ,{"key":"c3"} ] -tenant hash=3d8793ae2f59db3783450dc11a26a1025302d08f16f4baf9b3dfd7f9fad3d0ac +tenant hash=5ca8da78ef36d0aa2713f887df8a51c34e01622ed5369caaf2cd97cfab0f17ce ---- [{"key":""} ,{"key":"8b89898a89","value":"0312390a0673797374656d10011a250a0d0a0561646d696e1080101880100a0c0a04726f6f7410801018801012046e6f646518022200280140004a00"} @@ -203,8 +203,8 @@ tenant hash=3d8793ae2f59db3783450dc11a26a1025302d08f16f4baf9b3dfd7f9fad3d0ac ,{"key":"8b89af8a89","value":"030ad3030a0b73716c6c6976656e6573731827200128013a00422f0a0a73657373696f6e5f696410011a0c0808100018003000501160002000300068007000780080010088010098010042300a0a65787069726174696f6e10021a0d080310001800300050a40d60002000300068007000780080010088010098010042300a0b637264625f726567696f6e10031a0c0808100018003000501160002000300068007000780080010088010098010048045280010a077072696d61727910021801220b637264625f726567696f6e220a73657373696f6e5f69642a0a65787069726174696f6e30033001400040004a10080010001a00200028003000380040005a0070027a0408002000800100880100900104980101a20106080012001800a80100b20100ba0100c00100c80100d00101e0010060036a250a0d0a0561646d696e10e00318e0030a0c0a04726f6f7410e00318e00312046e6f64651802800101880103980100b201380a077072696d61727910001a0b637264625f726567696f6e1a0a73657373696f6e5f69641a0a65787069726174696f6e2003200120022802b80101c20100e80100f2010408001200f801008002009202009a0200b20200b80200c0021dc80200e00200800300880302a80300b00300"} ,{"key":"8b89b08a89","value":"030ac0040a0a6d6967726174696f6e731828200128013a00422a0a056d616a6f7210011a0c08011040180030005014600020003000680070007800800100880100980100422a0a056d696e6f7210021a0c08011040180030005014600020003000680070007800800100880100980100422a0a05706174636810031a0c08011040180030005014600020003000680070007800800100880100980100422d0a08696e7465726e616c10041a0c0801104018003000501460002000300068007000780080010088010098010042320a0c636f6d706c657465645f617410051a0d080910001800300050a00960002000300068007000780080010088010098010048065290010a077072696d6172791001180122056d616a6f7222056d696e6f72220570617463682208696e7465726e616c2a0c636f6d706c657465645f6174300130023003300440004000400040004a10080010001a00200028003000380040005a0070057a0408002000800100880100900104980101a20106080012001800a80100b20100ba0100c00100c80100d00101e0010060026a250a0d0a0561646d696e10e00318e0030a0c0a04726f6f7410e00318e00312046e6f64651802800101880103980100b201440a077072696d61727910001a056d616a6f721a056d696e6f721a0570617463681a08696e7465726e616c1a0c636f6d706c657465645f6174200120022003200420052805b80101c20100e80100f2010408001200f801008002009202009a0200b20200b80200c0021dc80200e00200800300880302a80300b00300"} ,{"key":"8b89b18a89","value":"030aaa030a0b6a6f696e5f746f6b656e731829200128013a0042280a02696410011a0d080e100018003000508617600020003000680070007800800100880100980100422b0a0673656372657410021a0c0808100018003000501160002000300068007000780080010088010098010042300a0a65787069726174696f6e10031a0d080910001800300050a009600020003000680070007800800100880100980100480452710a077072696d61727910011801220269642a067365637265742a0a65787069726174696f6e300140004a10080010001a00200028003000380040005a00700270037a0408002000800100880100900104980101a20106080012001800a80100b20100ba0100c00100c80100d00101e0010060026a250a0d0a0561646d696e10e00318e0030a0c0a04726f6f7410e00318e00312046e6f64651802800101880103980100b2012b0a077072696d61727910001a0269641a067365637265741a0a65787069726174696f6e2001200220032800b80101c20100e80100f2010408001200f801008002009202009a0200b20200b80200c0021dc80200e00200800300880302a80300b00300"} -,{"key":"8b89b28a89","value":"030abe140a1473746174656d656e745f73746174697374696373182a200128013a0042330a0d616767726567617465645f747310011a0d080910001800300050a00960002000300068007000780080010088010098010042330a0e66696e6765727072696e745f696410021a0c08081000180030005011600020003000680070007800800100880100980100423f0a1a7472616e73616374696f6e5f66696e6765727072696e745f696410031a0c08081000180030005011600020003000680070007800800100880100980100422e0a09706c616e5f6861736810041a0c08081000180030005011600020003000680070007800800100880100980100422d0a086170705f6e616d6510051a0c08071000180030005019600020003000680070007800800100880100980100422c0a076e6f64655f696410061a0c0801104018003000501460002000300068007000780080010088010098010042380a0c6167675f696e74657276616c10071a13080610001800300050a20960006a040800100020003000680070007800800100880100980100422e0a086d6574616461746110081a0d081210001800300050da1d60002000300068007000780080010088010098010042300a0a7374617469737469637310091a0d081210001800300050da1d600020003000680070007800800100880100980100422a0a04706c616e100a1a0d081210001800300050da1d600020003000680070007800800100880100980100429c020a68637264625f696e7465726e616c5f616767726567617465645f74735f6170705f6e616d655f66696e6765727072696e745f69645f6e6f64655f69645f706c616e5f686173685f7472616e73616374696f6e5f66696e6765727072696e745f69645f73686172645f38100b1a0c080110201800300050176000200030015a8c016d6f6428666e76333228637264625f696e7465726e616c2e646174756d735f746f5f627974657328616767726567617465645f74732c206170705f6e616d652c2066696e6765727072696e745f69642c206e6f64655f69642c20706c616e5f686173682c207472616e73616374696f6e5f66696e6765727072696e745f696429292c20383a3a3a494e543829680070007800800100880100980100425f0a15696e6465785f7265636f6d6d656e646174696f6e73100c1a1d080f100018003000380750f1075a0c080710001800300050196000600020002a1241525241595b5d3a3a3a535452494e475b5d3000680070007800800100880100980100426c0a0d696e64657865735f7573616765100d1a0d081210001800300050da1d6000200130005a3728737461746973746963732d3e2773746174697374696373273a3a3a535452494e47292d3e27696e6465786573273a3a3a535452494e47680070007800800101880100980100480e52bd040a077072696d617279100118012268637264625f696e7465726e616c5f616767726567617465645f74735f6170705f6e616d655f66696e6765727072696e745f69645f6e6f64655f69645f706c616e5f686173685f7472616e73616374696f6e5f66696e6765727072696e745f69645f73686172645f38220d616767726567617465645f7473220e66696e6765727072696e745f6964221a7472616e73616374696f6e5f66696e6765727072696e745f69642209706c616e5f6861736822086170705f6e616d6522076e6f64655f69642a0c6167675f696e74657276616c2a086d657461646174612a0a737461746973746963732a04706c616e2a15696e6465785f7265636f6d6d656e646174696f6e73300b30013002300330043005300640004000400040004000400040004a10080010001a00200028003000380040005a00700770087009700a700c7a0408002000800100880100900104980101a201c70108011268637264625f696e7465726e616c5f616767726567617465645f74735f6170705f6e616d655f66696e6765727072696e745f69645f6e6f64655f69645f706c616e5f686173685f7472616e73616374696f6e5f66696e6765727072696e745f69645f73686172645f381808220d616767726567617465645f747322086170705f6e616d65220e66696e6765727072696e745f696422076e6f64655f69642209706c616e5f68617368221a7472616e73616374696f6e5f66696e6765727072696e745f6964a80100b20100ba0100c00100c80100d00101e001005a9d010a1566696e6765727072696e745f73746174735f69647810021800220e66696e6765727072696e745f6964221a7472616e73616374696f6e5f66696e6765727072696e745f696430023003380b3801380438053806400040004a10080010001a00200028003000380040005a007a0408002000800100880100900103980100a20106080012001800a80100b20100ba0100c00100c80100d00100e001005a7f0a11696e64657865735f75736167655f69647810031800220d696e64657865735f7573616765300d380b38013802380338043805380640004a10080010001a00200028003000380040005a007a0408002000800101880100900103980100a20106080012001800a80100b20100ba0100c00100c80100d00100d80100e0010060046a210a0b0a0561646d696e102018200a0a0a04726f6f741020182012046e6f64651802800101880103980100a201b9020abc01637264625f696e7465726e616c5f616767726567617465645f74735f6170705f6e616d655f66696e6765727072696e745f69645f6e6f64655f69645f706c616e5f686173685f7472616e73616374696f6e5f66696e6765727072696e745f69645f73686172645f3820494e2028303a3a3a494e54382c20313a3a3a494e54382c20323a3a3a494e54382c20333a3a3a494e54382c20343a3a3a494e54382c20353a3a3a494e54382c20363a3a3a494e54382c20373a3a3a494e543829126e636865636b5f637264625f696e7465726e616c5f616767726567617465645f74735f6170705f6e616d655f66696e6765727072696e745f69645f6e6f64655f69645f706c616e5f686173685f7472616e73616374696f6e5f66696e6765727072696e745f69645f73686172645f381800280b300038014002b201a9020a077072696d61727910001a68637264625f696e7465726e616c5f616767726567617465645f74735f6170705f6e616d655f66696e6765727072696e745f69645f6e6f64655f69645f706c616e5f686173685f7472616e73616374696f6e5f66696e6765727072696e745f69645f73686172645f381a0d616767726567617465645f74731a0e66696e6765727072696e745f69641a1a7472616e73616374696f6e5f66696e6765727072696e745f69641a09706c616e5f686173681a086170705f6e616d651a076e6f64655f69641a0c6167675f696e74657276616c1a086d657461646174611a0a737461746973746963731a04706c616e1a15696e6465785f7265636f6d6d656e646174696f6e73200b200120022003200420052006200720082009200a200c2800b80101c20100e80100f2010408001200f801008002009202009a0200b20200b80200c0021dc80200e00200800300880303a80300b00300"} -,{"key":"8b89b38a89","value":"030ae60c0a167472616e73616374696f6e5f73746174697374696373182b200128013a0042330a0d616767726567617465645f747310011a0d080910001800300050a00960002000300068007000780080010088010098010042330a0e66696e6765727072696e745f696410021a0c08081000180030005011600020003000680070007800800100880100980100422d0a086170705f6e616d6510031a0c08071000180030005019600020003000680070007800800100880100980100422c0a076e6f64655f696410041a0c0801104018003000501460002000300068007000780080010088010098010042380a0c6167675f696e74657276616c10051a13080610001800300050a20960006a040800100020003000680070007800800100880100980100422e0a086d6574616461746110061a0d081210001800300050da1d60002000300068007000780080010088010098010042300a0a7374617469737469637310071a0d081210001800300050da1d60002000300068007000780080010088010098010042cf010a43637264625f696e7465726e616c5f616767726567617465645f74735f6170705f6e616d655f66696e6765727072696e745f69645f6e6f64655f69645f73686172645f3810081a0c080110201800300050176000200030015a656d6f6428666e76333228637264625f696e7465726e616c2e646174756d735f746f5f627974657328616767726567617465645f74732c206170705f6e616d652c2066696e6765727072696e745f69642c206e6f64655f696429292c20383a3a3a494e543829680070007800800100880100980100480952fb020a077072696d617279100118012243637264625f696e7465726e616c5f616767726567617465645f74735f6170705f6e616d655f66696e6765727072696e745f69645f6e6f64655f69645f73686172645f38220d616767726567617465645f7473220e66696e6765727072696e745f696422086170705f6e616d6522076e6f64655f69642a0c6167675f696e74657276616c2a086d657461646174612a0a7374617469737469637330083001300230033004400040004000400040004a10080010001a00200028003000380040005a007005700670077a0408002000800100880100900104980101a2017b08011243637264625f696e7465726e616c5f616767726567617465645f74735f6170705f6e616d655f66696e6765727072696e745f69645f6e6f64655f69645f73686172645f381808220d616767726567617465645f747322086170705f6e616d65220e66696e6765727072696e745f696422076e6f64655f6964a80100b20100ba0100c00100c80100d00101e001005a7b0a1566696e6765727072696e745f73746174735f69647810021800220e66696e6765727072696e745f69643002380838013803380440004a10080010001a00200028003000380040005a007a0408002000800100880100900103980100a20106080012001800a80100b20100ba0100c00100c80100d00100e0010060036a210a0b0a0561646d696e102018200a0a0a04726f6f741020182012046e6f64651802800101880103980100a201ef010a9701637264625f696e7465726e616c5f616767726567617465645f74735f6170705f6e616d655f66696e6765727072696e745f69645f6e6f64655f69645f73686172645f3820494e2028303a3a3a494e54382c20313a3a3a494e54382c20323a3a3a494e54382c20333a3a3a494e54382c20343a3a3a494e54382c20353a3a3a494e54382c20363a3a3a494e54382c20373a3a3a494e5438291249636865636b5f637264625f696e7465726e616c5f616767726567617465645f74735f6170705f6e616d655f66696e6765727072696e745f69645f6e6f64655f69645f73686172645f3818002808300038014002b201b8010a077072696d61727910001a43637264625f696e7465726e616c5f616767726567617465645f74735f6170705f6e616d655f66696e6765727072696e745f69645f6e6f64655f69645f73686172645f381a0d616767726567617465645f74731a0e66696e6765727072696e745f69641a086170705f6e616d651a076e6f64655f69641a0c6167675f696e74657276616c1a086d657461646174611a0a73746174697374696373200820012002200320042005200620072800b80101c20100e80100f2010408001200f801008002009202009a0200b20200b80200c0021dc80200e00200800300880303a80300b00300"} +,{"key":"8b89b28a89","value":"030ab7240a1473746174656d656e745f73746174697374696373182a200128013a0042330a0d616767726567617465645f747310011a0d080910001800300050a00960002000300068007000780080010088010098010042330a0e66696e6765727072696e745f696410021a0c08081000180030005011600020003000680070007800800100880100980100423f0a1a7472616e73616374696f6e5f66696e6765727072696e745f696410031a0c08081000180030005011600020003000680070007800800100880100980100422e0a09706c616e5f6861736810041a0c08081000180030005011600020003000680070007800800100880100980100422d0a086170705f6e616d6510051a0c08071000180030005019600020003000680070007800800100880100980100422c0a076e6f64655f696410061a0c0801104018003000501460002000300068007000780080010088010098010042380a0c6167675f696e74657276616c10071a13080610001800300050a20960006a040800100020003000680070007800800100880100980100422e0a086d6574616461746110081a0d081210001800300050da1d60002000300068007000780080010088010098010042300a0a7374617469737469637310091a0d081210001800300050da1d600020003000680070007800800100880100980100422a0a04706c616e100a1a0d081210001800300050da1d600020003000680070007800800100880100980100429c020a68637264625f696e7465726e616c5f616767726567617465645f74735f6170705f6e616d655f66696e6765727072696e745f69645f6e6f64655f69645f706c616e5f686173685f7472616e73616374696f6e5f66696e6765727072696e745f69645f73686172645f38100b1a0c080110201800300050176000200030015a8c016d6f6428666e76333228637264625f696e7465726e616c2e646174756d735f746f5f627974657328616767726567617465645f74732c206170705f6e616d652c2066696e6765727072696e745f69642c206e6f64655f69642c20706c616e5f686173682c207472616e73616374696f6e5f66696e6765727072696e745f696429292c20383a3a3a494e543829680070007800800100880100980100425f0a15696e6465785f7265636f6d6d656e646174696f6e73100c1a1d080f100018003000380750f1075a0c080710001800300050196000600020002a1241525241595b5d3a3a3a535452494e475b5d3000680070007800800100880100980100426c0a0d696e64657865735f7573616765100d1a0d081210001800300050da1d6000200130005a3728737461746973746963732d3e2773746174697374696373273a3a3a535452494e47292d3e27696e6465786573273a3a3a535452494e4768007000780080010188010098010042710a0f657865637574696f6e5f636f756e74100e1a0c080110401800300050146000200130005a3b2828737461746973746963732d3e2773746174697374696373273a3a3a535452494e47292d3e27636e74273a3a3a535452494e47293a3a494e5438680070007800800100880100980100428a010a0f736572766963655f6c6174656e6379100f1a0d080210401800300050bd056000200130005a53282828737461746973746963732d3e2773746174697374696373273a3a3a535452494e47292d3e277376634c6174273a3a3a535452494e47292d3e276d65616e273a3a3a535452494e47293a3a464c4f4154386800700078008001008801009801004297010a0d6370755f73716c5f6e616e6f7310101a0d080210401800300050bd056000200130005a62282828737461746973746963732d3e27657865637574696f6e5f73746174697374696373273a3a3a535452494e47292d3e2763707553514c4e616e6f73273a3a3a535452494e47292d3e276d65616e273a3a3a535452494e47293a3a464c4f415438680070007800800100880100980100429c010a0f636f6e74656e74696f6e5f74696d6510111a0d080210401800300050bd056000200130005a65282828737461746973746963732d3e27657865637574696f6e5f73746174697374696373273a3a3a535452494e47292d3e27636f6e74656e74696f6e54696d65273a3a3a535452494e47292d3e276d65616e273a3a3a535452494e47293a3a464c4f41543868007000780080010088010098010042db010a1e746f74616c5f657374696d617465645f657865637574696f6e5f74696d6510121a0d080210401800300050bd056000200130005a94012828737461746973746963732d3e2773746174697374696373273a3a3a535452494e47292d3e27636e74273a3a3a535452494e47293a3a464c4f415438202a20282828737461746973746963732d3e2773746174697374696373273a3a3a535452494e47292d3e277376634c6174273a3a3a535452494e47292d3e3e276d65616e273a3a3a535452494e47293a3a464c4f415438680070007800800100880100980100481352a9050a077072696d617279100118012268637264625f696e7465726e616c5f616767726567617465645f74735f6170705f6e616d655f66696e6765727072696e745f69645f6e6f64655f69645f706c616e5f686173685f7472616e73616374696f6e5f66696e6765727072696e745f69645f73686172645f38220d616767726567617465645f7473220e66696e6765727072696e745f6964221a7472616e73616374696f6e5f66696e6765727072696e745f69642209706c616e5f6861736822086170705f6e616d6522076e6f64655f69642a0c6167675f696e74657276616c2a086d657461646174612a0a737461746973746963732a04706c616e2a15696e6465785f7265636f6d6d656e646174696f6e732a0f657865637574696f6e5f636f756e742a0f736572766963655f6c6174656e63792a0d6370755f73716c5f6e616e6f732a0f636f6e74656e74696f6e5f74696d652a1e746f74616c5f657374696d617465645f657865637574696f6e5f74696d65300b30013002300330043005300640004000400040004000400040004a10080010001a00200028003000380040005a00700770087009700a700c700e700f7010701170127a0408002000800100880100900104980101a201c70108011268637264625f696e7465726e616c5f616767726567617465645f74735f6170705f6e616d655f66696e6765727072696e745f69645f6e6f64655f69645f706c616e5f686173685f7472616e73616374696f6e5f66696e6765727072696e745f69645f73686172645f381808220d616767726567617465645f747322086170705f6e616d65220e66696e6765727072696e745f696422076e6f64655f69642209706c616e5f68617368221a7472616e73616374696f6e5f66696e6765727072696e745f6964a80100b20100ba0100c00100c80100d00101e001005a9d010a1566696e6765727072696e745f73746174735f69647810021800220e66696e6765727072696e745f6964221a7472616e73616374696f6e5f66696e6765727072696e745f696430023003380b3801380438053806400040004a10080010001a00200028003000380040005a007a0408002000800100880100900103980100a20106080012001800a80100b20100ba0100c00100c80100d00100e001005a7f0a11696e64657865735f75736167655f69647810031800220d696e64657865735f7573616765300d380b38013802380338043805380640004a10080010001a00200028003000380040005a007a0408002000800101880100900103980100a20106080012001800a80100b20100ba0100c00100c80100d00100d80100e001005ac5010a13657865637574696f6e5f636f756e745f69647810041800220d616767726567617465645f747322086170705f6e616d65220f657865637574696f6e5f636f756e7430013005300e380b38023803380438064000400040014a10080010001a00200028003000380040005a007a0408002000800100880100900103980100a20106080012001800a80100b20100ba01286170705f6e616d65204e4f54204c494b4520272420696e7465726e616c25273a3a3a535452494e47c00100c80100d00100e001005ac7010a13736572766963655f6c6174656e63795f69647810051800220d616767726567617465645f747322086170705f6e616d65220f736572766963655f6c6174656e637930013005300f380b38023803380438064000400040014a10080010001a00200028003000380040005a00680f7a0408002000800100880100900103980100a20106080012001800a80100b20100ba01286170705f6e616d65204e4f54204c494b4520272420696e7465726e616c25273a3a3a535452494e47c00100c80100d00100e001005ac3010a116370755f73716c5f6e616e6f735f69647810061800220d616767726567617465645f747322086170705f6e616d65220d6370755f73716c5f6e616e6f73300130053010380b38023803380438064000400040014a10080010001a00200028003000380040005a0068107a0408002000800100880100900103980100a20106080012001800a80100b20100ba01286170705f6e616d65204e4f54204c494b4520272420696e7465726e616c25273a3a3a535452494e47c00100c80100d00100e001005ac7010a13636f6e74656e74696f6e5f74696d655f69647810071800220d616767726567617465645f747322086170705f6e616d65220f636f6e74656e74696f6e5f74696d65300130053011380b38023803380438064000400040014a10080010001a00200028003000380040005a0068117a0408002000800100880100900103980100a20106080012001800a80100b20100ba01286170705f6e616d65204e4f54204c494b4520272420696e7465726e616c25273a3a3a535452494e47c00100c80100d00100e001005ae5010a22746f74616c5f657374696d617465645f657865637574696f6e5f74696d655f69647810081800220d616767726567617465645f747322086170705f6e616d65221e746f74616c5f657374696d617465645f657865637574696f6e5f74696d65300130053012380b38023803380438064000400040014a10080010001a00200028003000380040005a0068127a0408002000800100880100900103980100a20106080012001800a80100b20100ba01286170705f6e616d65204e4f54204c494b4520272420696e7465726e616c25273a3a3a535452494e47c00100c80100d00100e0010060096a210a0b0a0561646d696e102018200a0a0a04726f6f741020182012046e6f64651802800101880103980100a201b9020abc01637264625f696e7465726e616c5f616767726567617465645f74735f6170705f6e616d655f66696e6765727072696e745f69645f6e6f64655f69645f706c616e5f686173685f7472616e73616374696f6e5f66696e6765727072696e745f69645f73686172645f3820494e2028303a3a3a494e54382c20313a3a3a494e54382c20323a3a3a494e54382c20333a3a3a494e54382c20343a3a3a494e54382c20353a3a3a494e54382c20363a3a3a494e54382c20373a3a3a494e543829126e636865636b5f637264625f696e7465726e616c5f616767726567617465645f74735f6170705f6e616d655f66696e6765727072696e745f69645f6e6f64655f69645f706c616e5f686173685f7472616e73616374696f6e5f66696e6765727072696e745f69645f73686172645f381800280b300038014002b20195030a077072696d61727910001a68637264625f696e7465726e616c5f616767726567617465645f74735f6170705f6e616d655f66696e6765727072696e745f69645f6e6f64655f69645f706c616e5f686173685f7472616e73616374696f6e5f66696e6765727072696e745f69645f73686172645f381a0d616767726567617465645f74731a0e66696e6765727072696e745f69641a1a7472616e73616374696f6e5f66696e6765727072696e745f69641a09706c616e5f686173681a086170705f6e616d651a076e6f64655f69641a0c6167675f696e74657276616c1a086d657461646174611a0a737461746973746963731a04706c616e1a15696e6465785f7265636f6d6d656e646174696f6e731a0f657865637574696f6e5f636f756e741a0f736572766963655f6c6174656e63791a0d6370755f73716c5f6e616e6f731a0f636f6e74656e74696f6e5f74696d651a1e746f74616c5f657374696d617465645f657865637574696f6e5f74696d65200b200120022003200420052006200720082009200a200c200e200f2010201120122800b80101c20100e80100f2010408001200f801008002009202009a0200b20200b80200c0021dc80200e00200800300880303a80300b00300"} +,{"key":"8b89b38a89","value":"030acb1c0a167472616e73616374696f6e5f73746174697374696373182b200128013a0042330a0d616767726567617465645f747310011a0d080910001800300050a00960002000300068007000780080010088010098010042330a0e66696e6765727072696e745f696410021a0c08081000180030005011600020003000680070007800800100880100980100422d0a086170705f6e616d6510031a0c08071000180030005019600020003000680070007800800100880100980100422c0a076e6f64655f696410041a0c0801104018003000501460002000300068007000780080010088010098010042380a0c6167675f696e74657276616c10051a13080610001800300050a20960006a040800100020003000680070007800800100880100980100422e0a086d6574616461746110061a0d081210001800300050da1d60002000300068007000780080010088010098010042300a0a7374617469737469637310071a0d081210001800300050da1d60002000300068007000780080010088010098010042cf010a43637264625f696e7465726e616c5f616767726567617465645f74735f6170705f6e616d655f66696e6765727072696e745f69645f6e6f64655f69645f73686172645f3810081a0c080110201800300050176000200030015a656d6f6428666e76333228637264625f696e7465726e616c2e646174756d735f746f5f627974657328616767726567617465645f74732c206170705f6e616d652c2066696e6765727072696e745f69642c206e6f64655f696429292c20383a3a3a494e54382968007000780080010088010098010042710a0f657865637574696f6e5f636f756e7410091a0c080110401800300050146000200130005a3b2828737461746973746963732d3e2773746174697374696373273a3a3a535452494e47292d3e27636e74273a3a3a535452494e47293a3a494e5438680070007800800100880100980100428a010a0f736572766963655f6c6174656e6379100a1a0d080210401800300050bd056000200130005a53282828737461746973746963732d3e2773746174697374696373273a3a3a535452494e47292d3e277376634c6174273a3a3a535452494e47292d3e276d65616e273a3a3a535452494e47293a3a464c4f4154386800700078008001008801009801004297010a0d6370755f73716c5f6e616e6f73100b1a0d080210401800300050bd056000200130005a62282828737461746973746963732d3e27657865637574696f6e5f73746174697374696373273a3a3a535452494e47292d3e2763707553514c4e616e6f73273a3a3a535452494e47292d3e276d65616e273a3a3a535452494e47293a3a464c4f415438680070007800800100880100980100429c010a0f636f6e74656e74696f6e5f74696d65100c1a0d080210401800300050bd056000200130005a65282828737461746973746963732d3e27657865637574696f6e5f73746174697374696373273a3a3a535452494e47292d3e27636f6e74656e74696f6e54696d65273a3a3a535452494e47292d3e276d65616e273a3a3a535452494e47293a3a464c4f41543868007000780080010088010098010042db010a1e746f74616c5f657374696d617465645f657865637574696f6e5f74696d65100d1a0d080210401800300050bd056000200130005a94012828737461746973746963732d3e2773746174697374696373273a3a3a535452494e47292d3e27636e74273a3a3a535452494e47293a3a464c4f415438202a20282828737461746973746963732d3e2773746174697374696373273a3a3a535452494e47292d3e277376634c6174273a3a3a535452494e47292d3e3e276d65616e273a3a3a535452494e47293a3a464c4f415438680070007800800100880100980100480e52e7030a077072696d617279100118012243637264625f696e7465726e616c5f616767726567617465645f74735f6170705f6e616d655f66696e6765727072696e745f69645f6e6f64655f69645f73686172645f38220d616767726567617465645f7473220e66696e6765727072696e745f696422086170705f6e616d6522076e6f64655f69642a0c6167675f696e74657276616c2a086d657461646174612a0a737461746973746963732a0f657865637574696f6e5f636f756e742a0f736572766963655f6c6174656e63792a0d6370755f73716c5f6e616e6f732a0f636f6e74656e74696f6e5f74696d652a1e746f74616c5f657374696d617465645f657865637574696f6e5f74696d6530083001300230033004400040004000400040004a10080010001a00200028003000380040005a007005700670077009700a700b700c700d7a0408002000800100880100900104980101a2017b08011243637264625f696e7465726e616c5f616767726567617465645f74735f6170705f6e616d655f66696e6765727072696e745f69645f6e6f64655f69645f73686172645f381808220d616767726567617465645f747322086170705f6e616d65220e66696e6765727072696e745f696422076e6f64655f6964a80100b20100ba0100c00100c80100d00101e001005a7b0a1566696e6765727072696e745f73746174735f69647810021800220e66696e6765727072696e745f69643002380838013803380440004a10080010001a00200028003000380040005a007a0408002000800100880100900103980100a20106080012001800a80100b20100ba0100c00100c80100d00100e001005ac1010a13657865637574696f6e5f636f756e745f69647810031800220d616767726567617465645f747322086170705f6e616d65220f657865637574696f6e5f636f756e743001300330093808380238044000400040014a10080010001a00200028003000380040005a007a0408002000800100880100900103980100a20106080012001800a80100b20100ba01286170705f6e616d65204e4f54204c494b4520272420696e7465726e616c25273a3a3a535452494e47c00100c80100d00100e001005ac3010a13736572766963655f6c6174656e63795f69647810041800220d616767726567617465645f747322086170705f6e616d65220f736572766963655f6c6174656e637930013003300a3808380238044000400040014a10080010001a00200028003000380040005a00680a7a0408002000800100880100900103980100a20106080012001800a80100b20100ba01286170705f6e616d65204e4f54204c494b4520272420696e7465726e616c25273a3a3a535452494e47c00100c80100d00100e001005abf010a116370755f73716c5f6e616e6f735f69647810051800220d616767726567617465645f747322086170705f6e616d65220d6370755f73716c5f6e616e6f7330013003300b3808380238044000400040014a10080010001a00200028003000380040005a00680b7a0408002000800100880100900103980100a20106080012001800a80100b20100ba01286170705f6e616d65204e4f54204c494b4520272420696e7465726e616c25273a3a3a535452494e47c00100c80100d00100e001005ac3010a13636f6e74656e74696f6e5f74696d655f69647810061800220d616767726567617465645f747322086170705f6e616d65220f636f6e74656e74696f6e5f74696d6530013003300c3808380238044000400040014a10080010001a00200028003000380040005a00680c7a0408002000800100880100900103980100a20106080012001800a80100b20100ba01286170705f6e616d65204e4f54204c494b4520272420696e7465726e616c25273a3a3a535452494e47c00100c80100d00100e001005ae1010a22746f74616c5f657374696d617465645f657865637574696f6e5f74696d655f69647810071800220d616767726567617465645f747322086170705f6e616d65221e746f74616c5f657374696d617465645f657865637574696f6e5f74696d6530013003300d3808380238044000400040014a10080010001a00200028003000380040005a00680d7a0408002000800100880100900103980100a20106080012001800a80100b20100ba01286170705f6e616d65204e4f54204c494b4520272420696e7465726e616c25273a3a3a535452494e47c00100c80100d00100e0010060086a210a0b0a0561646d696e102018200a0a0a04726f6f741020182012046e6f64651802800101880103980100a201ef010a9701637264625f696e7465726e616c5f616767726567617465645f74735f6170705f6e616d655f66696e6765727072696e745f69645f6e6f64655f69645f73686172645f3820494e2028303a3a3a494e54382c20313a3a3a494e54382c20323a3a3a494e54382c20333a3a3a494e54382c20343a3a3a494e54382c20353a3a3a494e54382c20363a3a3a494e54382c20373a3a3a494e5438291249636865636b5f637264625f696e7465726e616c5f616767726567617465645f74735f6170705f6e616d655f66696e6765727072696e745f69645f6e6f64655f69645f73686172645f3818002808300038014002b201a4020a077072696d61727910001a43637264625f696e7465726e616c5f616767726567617465645f74735f6170705f6e616d655f66696e6765727072696e745f69645f6e6f64655f69645f73686172645f381a0d616767726567617465645f74731a0e66696e6765727072696e745f69641a086170705f6e616d651a076e6f64655f69641a0c6167675f696e74657276616c1a086d657461646174611a0a737461746973746963731a0f657865637574696f6e5f636f756e741a0f736572766963655f6c6174656e63791a0d6370755f73716c5f6e616e6f731a0f636f6e74656e74696f6e5f74696d651a1e746f74616c5f657374696d617465645f657865637574696f6e5f74696d65200820012002200320042005200620072009200a200b200c200d2800b80101c20100e80100f2010408001200f801008002009202009a0200b20200b80200c0021dc80200e00200800300880303a80300b00300"} ,{"key":"8b89b48a89","value":"030ad0050a1664617461626173655f726f6c655f73657474696e6773182c200128013a0042300a0b64617461626173655f696410011a0c080c100018003000501a600020003000680070007800800100880100980100422e0a09726f6c655f6e616d6510021a0c08071000180030005019600020003000680070007800800100880100980100423e0a0873657474696e677310031a1d080f100018003000380750f1075a0c080710001800300050196000600020003000680070007800800100880100980100422c0a07726f6c655f696410041a0c080c100018003000501a60002000300068007000780080010088010098010048055288010a077072696d61727910011801220b64617461626173655f69642209726f6c655f6e616d652a0873657474696e67732a07726f6c655f696430013002400040004a10080010001a00200028003000380040005a00700370047a0408002000800100880100900104980101a20106080012001800a80100b20100ba0100c00100c80100d00102e001005aa4010a2e64617461626173655f726f6c655f73657474696e67735f64617461626173655f69645f726f6c655f69645f6b657910021801220b64617461626173655f69642207726f6c655f69642a0873657474696e6773300130043802400040004a10080010001a00200028003000380040005a0070037a0408002000800100880100900103980100a20106080012001800a80100b20100ba0100c00100c80100d00101e0010060036a250a0d0a0561646d696e10e00318e0030a0c0a04726f6f7410e00318e00312046e6f64651802800101880103980100b201400a077072696d61727910001a0b64617461626173655f69641a09726f6c655f6e616d651a0873657474696e67731a07726f6c655f696420012002200320042800b80101c20100e80100f2010408001200f801008002009202009a0200b20200b80200c0021dc80200e00200800300880303a80300b00300"} ,{"key":"8b89b68a89","value":"030adf050a0d73716c5f696e7374616e636573182e200128013a0042270a02696410011a0c0801104018003000501460002000300068007000780080010088010098010042290a046164647210021a0c08071000180030005019600020013000680070007800800100880100980100422f0a0a73657373696f6e5f696410031a0c08081000180030005011600020013000680070007800800100880100980100422e0a086c6f63616c69747910041a0d081210001800300050da1d600020013000680070007800800100880100980100422d0a0873716c5f6164647210051a0c0807100018003000501960002001300068007000780080010088010098010042300a0b637264625f726567696f6e10061a0c0808100018003000501160002000300068007000780080010088010098010042330a0e62696e6172795f76657273696f6e10071a0c08071000180030005019600020013000680070007800800100880100980100480852aa010a077072696d61727910021801220b637264625f726567696f6e220269642a04616464722a0a73657373696f6e5f69642a086c6f63616c6974792a0873716c5f616464722a0e62696e6172795f76657273696f6e30063001400040004a10080010001a00200028003000380040005a00700270037004700570077a0408002000800100880100900104980101a20106080012001800a80100b20100ba0100c00100c80100d00101e0010060036a250a0d0a0561646d696e10e00318e0030a0c0a04726f6f7410e00318e00312046e6f64651802800101880103980100b201620a077072696d61727910001a0269641a04616464721a0a73657373696f6e5f69641a086c6f63616c6974791a0873716c5f616464721a0b637264625f726567696f6e1a0e62696e6172795f76657273696f6e20012002200320042005200620072800b80101c20100e80100f2010408001200f801008002009202009a0200b20200b80200c0021dc80200e00200800300880302a80300b00300"} ,{"key":"8b89b88a89","value":"030abe020a0b726f6c655f69645f7365711830200128013a00422a0a0576616c756510011a0c080110401800300050146000200030006800700078008001008801009801004800525c0a077072696d61727910011800220576616c7565300140004a10080010001a00200028003000380040005a007a0408002000800100880100900104980101a20106080012001800a80100b20100ba0100c00100c80100d00100e0010060006a250a0d0a0561646d696e10a00618a0060a0c0a04726f6f7410a00618a00612046e6f64651802800100880103980100b201160a077072696d61727910001a0576616c756520012801b80100c20100e201180801106418ffffffff072064280032040800100038014200e80100f2010408001200f801008002009202009a0200b20200b80200c0021dc80200e00200800300880300a80300b00300"} diff --git a/pkg/sql/catalog/systemschema/system.go b/pkg/sql/catalog/systemschema/system.go index 93b40a34c3da..37874b2466be 100644 --- a/pkg/sql/catalog/systemschema/system.go +++ b/pkg/sql/catalog/systemschema/system.go @@ -120,10 +120,20 @@ CREATE TABLE system.tenants ( RoleIDSequenceSchema = ` CREATE SEQUENCE system.role_id_seq START 100 MINVALUE 100 MAXVALUE 2147483647;` - indexUsageComputeExpr = `(statistics->'statistics':::STRING)->'indexes':::STRING` + indexUsageComputeExpr = `(statistics->'statistics':::STRING)->'indexes':::STRING` + executionCountComputeExpr = `((statistics->'statistics':::STRING)->'cnt':::STRING)::INT8` + serviceLatencyComputeExpr = `(((statistics->'statistics':::STRING)->'svcLat':::STRING)->'mean':::STRING)::FLOAT8` + cpuSqlNanosComputeExpr = `(((statistics->'execution_statistics':::STRING)->'cpuSQLNanos':::STRING)->'mean':::STRING)::FLOAT8` + contentionTimeComputeExpr = `(((statistics->'execution_statistics':::STRING)->'contentionTime':::STRING)->'mean':::STRING)::FLOAT8` + totalEstimatedExecutionTimeExpr = `((statistics->'statistics':::STRING)->'cnt':::STRING)::FLOAT8 * (((statistics->'statistics':::STRING)->'svcLat':::STRING)->>'mean':::STRING)::FLOAT8` ) var indexUsageComputeExprStr = indexUsageComputeExpr +var executionCountComputeExprStr = executionCountComputeExpr +var serviceLatencyComputeExprStr = serviceLatencyComputeExpr +var cpuSqlNanosComputeExprStr = cpuSqlNanosComputeExpr +var contentionTimeComputeExprStr = contentionTimeComputeExpr +var totalEstimatedExecutionTimeExprStr = totalEstimatedExecutionTimeExpr // These system tables are not part of the system config. const ( @@ -528,11 +538,21 @@ CREATE TABLE system.statement_statistics ( index_recommendations STRING[] NOT NULL DEFAULT (array[]::STRING[]), indexes_usage JSONB AS (` + indexUsageComputeExpr + `) VIRTUAL, + execution_count INT8 AS (` + executionCountComputeExpr + `) STORED, + service_latency FLOAT AS (` + serviceLatencyComputeExpr + `) STORED, + cpu_sql_nanos FLOAT AS (` + cpuSqlNanosComputeExpr + `) STORED, + contention_time FLOAT AS (` + contentionTimeComputeExpr + `) STORED, + total_estimated_execution_time FLOAT AS (` + totalEstimatedExecutionTimeExpr + `) STORED, CONSTRAINT "primary" PRIMARY KEY (aggregated_ts, fingerprint_id, transaction_fingerprint_id, plan_hash, app_name, node_id) USING HASH WITH (bucket_count=8), INDEX "fingerprint_stats_idx" (fingerprint_id, transaction_fingerprint_id), INVERTED INDEX "indexes_usage_idx" (indexes_usage), + INDEX "execution_count_idx" (aggregated_ts, app_name, execution_count DESC) WHERE app_name NOT LIKE '$ internal%', + INDEX "service_latency_idx" (aggregated_ts, app_name, service_latency DESC) WHERE app_name NOT LIKE '$ internal%', + INDEX "cpu_sql_nanos_idx" (aggregated_ts, app_name, cpu_sql_nanos DESC) WHERE app_name NOT LIKE '$ internal%', + INDEX "contention_time_idx" (aggregated_ts, app_name, contention_time DESC) WHERE app_name NOT LIKE '$ internal%', + INDEX "total_estimated_execution_time_idx" (aggregated_ts, app_name, total_estimated_execution_time DESC) WHERE app_name NOT LIKE '$ internal%', FAMILY "primary" ( crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_plan_hash_transaction_fingerprint_id_shard_8, aggregated_ts, @@ -545,7 +565,12 @@ CREATE TABLE system.statement_statistics ( metadata, statistics, plan, - index_recommendations + index_recommendations, + execution_count, + service_latency, + cpu_sql_nanos, + contention_time, + total_estimated_execution_time ) ) ` @@ -564,10 +589,20 @@ CREATE TABLE system.transaction_statistics ( crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_shard_8 INT4 NOT VISIBLE NOT NULL AS ( mod(fnv32("crdb_internal.datums_to_bytes"(aggregated_ts, app_name, fingerprint_id, node_id)), 8:::INT8 )) STORED, + execution_count INT8 AS (` + executionCountComputeExpr + `) STORED, + service_latency FLOAT AS (` + serviceLatencyComputeExpr + `) STORED, + cpu_sql_nanos FLOAT AS (` + cpuSqlNanosComputeExpr + `) STORED, + contention_time FLOAT AS (` + contentionTimeComputeExpr + `) STORED, + total_estimated_execution_time FLOAT AS (` + totalEstimatedExecutionTimeExpr + `) STORED, CONSTRAINT "primary" PRIMARY KEY (aggregated_ts, fingerprint_id, app_name, node_id) USING HASH WITH (bucket_count=8), INDEX "fingerprint_stats_idx" (fingerprint_id), + INDEX "execution_count_idx" (aggregated_ts, app_name, execution_count DESC) WHERE app_name NOT LIKE '$ internal%', + INDEX "service_latency_idx" (aggregated_ts, app_name, service_latency DESC) WHERE app_name NOT LIKE '$ internal%', + INDEX "cpu_sql_nanos_idx" (aggregated_ts, app_name, cpu_sql_nanos DESC) WHERE app_name NOT LIKE '$ internal%', + INDEX "contention_time_idx" (aggregated_ts, app_name, contention_time DESC) WHERE app_name NOT LIKE '$ internal%', + INDEX "total_estimated_execution_time_idx" (aggregated_ts, app_name, total_estimated_execution_time DESC) WHERE app_name NOT LIKE '$ internal%', FAMILY "primary" ( crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_shard_8, aggregated_ts, @@ -576,7 +611,12 @@ CREATE TABLE system.transaction_statistics ( node_id, agg_interval, metadata, - statistics + statistics, + execution_count, + service_latency, + cpu_sql_nanos, + contention_time, + total_estimated_execution_time ) ); ` @@ -2439,6 +2479,11 @@ var ( }, {Name: "index_recommendations", ID: 12, Type: types.StringArray, Nullable: false, DefaultExpr: &defaultIndexRec}, {Name: "indexes_usage", ID: 13, Type: types.Jsonb, Nullable: true, Virtual: true, ComputeExpr: &indexUsageComputeExprStr}, + {Name: "execution_count", ID: 14, Type: types.Int, Nullable: true, ComputeExpr: &executionCountComputeExprStr}, + {Name: "service_latency", ID: 15, Type: types.Float, Nullable: true, ComputeExpr: &serviceLatencyComputeExprStr}, + {Name: "cpu_sql_nanos", ID: 16, Type: types.Float, Nullable: true, ComputeExpr: &cpuSqlNanosComputeExprStr}, + {Name: "contention_time", ID: 17, Type: types.Float, Nullable: true, ComputeExpr: &contentionTimeComputeExprStr}, + {Name: "total_estimated_execution_time", ID: 18, Type: types.Float, Nullable: true, ComputeExpr: &totalEstimatedExecutionTimeExprStr}, }, []descpb.ColumnFamilyDescriptor{ { @@ -2447,9 +2492,10 @@ var ( ColumnNames: []string{ "crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_plan_hash_transaction_fingerprint_id_shard_8", "aggregated_ts", "fingerprint_id", "transaction_fingerprint_id", "plan_hash", "app_name", "node_id", - "agg_interval", "metadata", "statistics", "plan", "index_recommendations", + "agg_interval", "metadata", "statistics", "plan", "index_recommendations", "execution_count", + "service_latency", "cpu_sql_nanos", "contention_time", "total_estimated_execution_time", }, - ColumnIDs: []descpb.ColumnID{11, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12}, + ColumnIDs: []descpb.ColumnID{11, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15, 16, 17, 18}, DefaultColumnID: 0, }, }, @@ -2523,6 +2569,105 @@ var ( Type: descpb.IndexDescriptor_INVERTED, InvertedColumnKinds: []catpb.InvertedIndexColumnKind{catpb.InvertedIndexColumnKind_DEFAULT}, }, + descpb.IndexDescriptor{ + Name: "execution_count_idx", + ID: 4, + Unique: false, + KeyColumnNames: []string{ + "aggregated_ts", + "app_name", + "execution_count", + }, + KeyColumnDirections: []catenumpb.IndexColumn_Direction{ + catenumpb.IndexColumn_ASC, + catenumpb.IndexColumn_ASC, + catenumpb.IndexColumn_DESC, + }, + KeyColumnIDs: []descpb.ColumnID{1, 5, 14}, + KeySuffixColumnIDs: []descpb.ColumnID{11, 2, 3, 4, 6}, + Version: descpb.StrictIndexColumnIDGuaranteesVersion, + Predicate: "app_name NOT LIKE '$ internal%':::STRING", + }, + descpb.IndexDescriptor{ + Name: "service_latency_idx", + ID: 5, + Unique: false, + KeyColumnNames: []string{ + "aggregated_ts", + "app_name", + "service_latency", + }, + KeyColumnDirections: []catenumpb.IndexColumn_Direction{ + catenumpb.IndexColumn_ASC, + catenumpb.IndexColumn_ASC, + catenumpb.IndexColumn_DESC, + }, + KeyColumnIDs: []descpb.ColumnID{1, 5, 15}, + KeySuffixColumnIDs: []descpb.ColumnID{11, 2, 3, 4, 6}, + CompositeColumnIDs: []descpb.ColumnID{15}, + Version: descpb.StrictIndexColumnIDGuaranteesVersion, + Predicate: "app_name NOT LIKE '$ internal%':::STRING", + }, + descpb.IndexDescriptor{ + Name: "cpu_sql_nanos_idx", + ID: 6, + Unique: false, + KeyColumnNames: []string{ + "aggregated_ts", + "app_name", + "cpu_sql_nanos", + }, + KeyColumnDirections: []catenumpb.IndexColumn_Direction{ + catenumpb.IndexColumn_ASC, + catenumpb.IndexColumn_ASC, + catenumpb.IndexColumn_DESC, + }, + KeyColumnIDs: []descpb.ColumnID{1, 5, 16}, + KeySuffixColumnIDs: []descpb.ColumnID{11, 2, 3, 4, 6}, + CompositeColumnIDs: []descpb.ColumnID{16}, + Version: descpb.StrictIndexColumnIDGuaranteesVersion, + Predicate: "app_name NOT LIKE '$ internal%':::STRING", + }, + descpb.IndexDescriptor{ + Name: "contention_time_idx", + ID: 7, + Unique: false, + KeyColumnNames: []string{ + "aggregated_ts", + "app_name", + "contention_time", + }, + KeyColumnDirections: []catenumpb.IndexColumn_Direction{ + catenumpb.IndexColumn_ASC, + catenumpb.IndexColumn_ASC, + catenumpb.IndexColumn_DESC, + }, + KeyColumnIDs: []descpb.ColumnID{1, 5, 17}, + KeySuffixColumnIDs: []descpb.ColumnID{11, 2, 3, 4, 6}, + CompositeColumnIDs: []descpb.ColumnID{17}, + Version: descpb.StrictIndexColumnIDGuaranteesVersion, + Predicate: "app_name NOT LIKE '$ internal%':::STRING", + }, + descpb.IndexDescriptor{ + Name: "total_estimated_execution_time_idx", + ID: 8, + Unique: false, + KeyColumnNames: []string{ + "aggregated_ts", + "app_name", + "total_estimated_execution_time", + }, + KeyColumnDirections: []catenumpb.IndexColumn_Direction{ + catenumpb.IndexColumn_ASC, + catenumpb.IndexColumn_ASC, + catenumpb.IndexColumn_DESC, + }, + KeyColumnIDs: []descpb.ColumnID{1, 5, 18}, + KeySuffixColumnIDs: []descpb.ColumnID{11, 2, 3, 4, 6}, + CompositeColumnIDs: []descpb.ColumnID{18}, + Version: descpb.StrictIndexColumnIDGuaranteesVersion, + Predicate: "app_name NOT LIKE '$ internal%':::STRING", + }, ), func(tbl *descpb.TableDescriptor) { tbl.Checks = []*descpb.TableDescriptor_CheckConstraint{{ @@ -2559,6 +2704,11 @@ var ( ComputeExpr: &sqlTxnHashComputeExpr, Hidden: true, }, + {Name: "execution_count", ID: 9, Type: types.Int, Nullable: true, ComputeExpr: &executionCountComputeExprStr}, + {Name: "service_latency", ID: 10, Type: types.Float, Nullable: true, ComputeExpr: &serviceLatencyComputeExprStr}, + {Name: "cpu_sql_nanos", ID: 11, Type: types.Float, Nullable: true, ComputeExpr: &cpuSqlNanosComputeExprStr}, + {Name: "contention_time", ID: 12, Type: types.Float, Nullable: true, ComputeExpr: &contentionTimeComputeExprStr}, + {Name: "total_estimated_execution_time", ID: 13, Type: types.Float, Nullable: true, ComputeExpr: &totalEstimatedExecutionTimeExprStr}, }, []descpb.ColumnFamilyDescriptor{ { @@ -2567,9 +2717,10 @@ var ( ColumnNames: []string{ "crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_shard_8", "aggregated_ts", "fingerprint_id", "app_name", "node_id", - "agg_interval", "metadata", "statistics", + "agg_interval", "metadata", "statistics", "execution_count", "service_latency", "cpu_sql_nanos", + "contention_time", "total_estimated_execution_time", }, - ColumnIDs: []descpb.ColumnID{8, 1, 2, 3, 4, 5, 6, 7}, + ColumnIDs: []descpb.ColumnID{8, 1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13}, DefaultColumnID: 0, }, }, @@ -2619,6 +2770,105 @@ var ( KeySuffixColumnIDs: []descpb.ColumnID{8, 1, 3, 4}, Version: descpb.StrictIndexColumnIDGuaranteesVersion, }, + descpb.IndexDescriptor{ + Name: "execution_count_idx", + ID: 3, + Unique: false, + KeyColumnNames: []string{ + "aggregated_ts", + "app_name", + "execution_count", + }, + KeyColumnDirections: []catenumpb.IndexColumn_Direction{ + catenumpb.IndexColumn_ASC, + catenumpb.IndexColumn_ASC, + catenumpb.IndexColumn_DESC, + }, + KeyColumnIDs: []descpb.ColumnID{1, 3, 9}, + KeySuffixColumnIDs: []descpb.ColumnID{8, 2, 4}, + Version: descpb.StrictIndexColumnIDGuaranteesVersion, + Predicate: "app_name NOT LIKE '$ internal%':::STRING", + }, + descpb.IndexDescriptor{ + Name: "service_latency_idx", + ID: 4, + Unique: false, + KeyColumnNames: []string{ + "aggregated_ts", + "app_name", + "service_latency", + }, + KeyColumnDirections: []catenumpb.IndexColumn_Direction{ + catenumpb.IndexColumn_ASC, + catenumpb.IndexColumn_ASC, + catenumpb.IndexColumn_DESC, + }, + KeyColumnIDs: []descpb.ColumnID{1, 3, 10}, + KeySuffixColumnIDs: []descpb.ColumnID{8, 2, 4}, + CompositeColumnIDs: []descpb.ColumnID{10}, + Version: descpb.StrictIndexColumnIDGuaranteesVersion, + Predicate: "app_name NOT LIKE '$ internal%':::STRING", + }, + descpb.IndexDescriptor{ + Name: "cpu_sql_nanos_idx", + ID: 5, + Unique: false, + KeyColumnNames: []string{ + "aggregated_ts", + "app_name", + "cpu_sql_nanos", + }, + KeyColumnDirections: []catenumpb.IndexColumn_Direction{ + catenumpb.IndexColumn_ASC, + catenumpb.IndexColumn_ASC, + catenumpb.IndexColumn_DESC, + }, + KeyColumnIDs: []descpb.ColumnID{1, 3, 11}, + KeySuffixColumnIDs: []descpb.ColumnID{8, 2, 4}, + CompositeColumnIDs: []descpb.ColumnID{11}, + Version: descpb.StrictIndexColumnIDGuaranteesVersion, + Predicate: "app_name NOT LIKE '$ internal%':::STRING", + }, + descpb.IndexDescriptor{ + Name: "contention_time_idx", + ID: 6, + Unique: false, + KeyColumnNames: []string{ + "aggregated_ts", + "app_name", + "contention_time", + }, + KeyColumnDirections: []catenumpb.IndexColumn_Direction{ + catenumpb.IndexColumn_ASC, + catenumpb.IndexColumn_ASC, + catenumpb.IndexColumn_DESC, + }, + KeyColumnIDs: []descpb.ColumnID{1, 3, 12}, + KeySuffixColumnIDs: []descpb.ColumnID{8, 2, 4}, + CompositeColumnIDs: []descpb.ColumnID{12}, + Version: descpb.StrictIndexColumnIDGuaranteesVersion, + Predicate: "app_name NOT LIKE '$ internal%':::STRING", + }, + descpb.IndexDescriptor{ + Name: "total_estimated_execution_time_idx", + ID: 7, + Unique: false, + KeyColumnNames: []string{ + "aggregated_ts", + "app_name", + "total_estimated_execution_time", + }, + KeyColumnDirections: []catenumpb.IndexColumn_Direction{ + catenumpb.IndexColumn_ASC, + catenumpb.IndexColumn_ASC, + catenumpb.IndexColumn_DESC, + }, + KeyColumnIDs: []descpb.ColumnID{1, 3, 13}, + KeySuffixColumnIDs: []descpb.ColumnID{8, 2, 4}, + CompositeColumnIDs: []descpb.ColumnID{13}, + Version: descpb.StrictIndexColumnIDGuaranteesVersion, + Predicate: "app_name NOT LIKE '$ internal%':::STRING", + }, ), func(tbl *descpb.TableDescriptor) { tbl.Checks = []*descpb.TableDescriptor_CheckConstraint{{ diff --git a/pkg/sql/catalog/systemschema_test/testdata/bootstrap b/pkg/sql/catalog/systemschema_test/testdata/bootstrap index 136f3ff58e01..22cf16df964d 100644 --- a/pkg/sql/catalog/systemschema_test/testdata/bootstrap +++ b/pkg/sql/catalog/systemschema_test/testdata/bootstrap @@ -331,9 +331,19 @@ CREATE TABLE public.statement_statistics ( crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_plan_hash_transaction_fingerprint_id_shard_8 INT4 NOT VISIBLE NOT NULL AS (mod(fnv32(crdb_internal.datums_to_bytes(aggregated_ts, app_name, fingerprint_id, node_id, plan_hash, transaction_fingerprint_id)), 8:::INT8)) STORED, index_recommendations STRING[] NOT NULL DEFAULT ARRAY[]:::STRING[], indexes_usage JSONB NULL AS ((statistics->'statistics':::STRING)->'indexes':::STRING) VIRTUAL, + execution_count INT8 NULL AS (((statistics->'statistics':::STRING)->'cnt':::STRING)::INT8) STORED, + service_latency FLOAT8 NULL AS ((((statistics->'statistics':::STRING)->'svcLat':::STRING)->'mean':::STRING)::FLOAT8) STORED, + cpu_sql_nanos FLOAT8 NULL AS ((((statistics->'execution_statistics':::STRING)->'cpuSQLNanos':::STRING)->'mean':::STRING)::FLOAT8) STORED, + contention_time FLOAT8 NULL AS ((((statistics->'execution_statistics':::STRING)->'contentionTime':::STRING)->'mean':::STRING)::FLOAT8) STORED, + total_estimated_execution_time FLOAT8 NULL AS (((statistics->'statistics':::STRING)->'cnt':::STRING)::FLOAT8 * (((statistics->'statistics':::STRING)->'svcLat':::STRING)->>'mean':::STRING)::FLOAT8) STORED, CONSTRAINT "primary" PRIMARY KEY (aggregated_ts ASC, fingerprint_id ASC, transaction_fingerprint_id ASC, plan_hash ASC, app_name ASC, node_id ASC) USING HASH WITH (bucket_count=8), INDEX fingerprint_stats_idx (fingerprint_id ASC, transaction_fingerprint_id ASC), - INVERTED INDEX indexes_usage_idx (indexes_usage) + INVERTED INDEX indexes_usage_idx (indexes_usage), + INDEX execution_count_idx (aggregated_ts ASC, app_name ASC, execution_count DESC) WHERE app_name NOT LIKE '$ internal%':::STRING, + INDEX service_latency_idx (aggregated_ts ASC, app_name ASC, service_latency DESC) WHERE app_name NOT LIKE '$ internal%':::STRING, + INDEX cpu_sql_nanos_idx (aggregated_ts ASC, app_name ASC, cpu_sql_nanos DESC) WHERE app_name NOT LIKE '$ internal%':::STRING, + INDEX contention_time_idx (aggregated_ts ASC, app_name ASC, contention_time DESC) WHERE app_name NOT LIKE '$ internal%':::STRING, + INDEX total_estimated_execution_time_idx (aggregated_ts ASC, app_name ASC, total_estimated_execution_time DESC) WHERE app_name NOT LIKE '$ internal%':::STRING ); CREATE TABLE public.transaction_statistics ( aggregated_ts TIMESTAMPTZ NOT NULL, @@ -344,8 +354,18 @@ CREATE TABLE public.transaction_statistics ( metadata JSONB NOT NULL, statistics JSONB NOT NULL, crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_shard_8 INT4 NOT VISIBLE NOT NULL AS (mod(fnv32(crdb_internal.datums_to_bytes(aggregated_ts, app_name, fingerprint_id, node_id)), 8:::INT8)) STORED, + execution_count INT8 NULL AS (((statistics->'statistics':::STRING)->'cnt':::STRING)::INT8) STORED, + service_latency FLOAT8 NULL AS ((((statistics->'statistics':::STRING)->'svcLat':::STRING)->'mean':::STRING)::FLOAT8) STORED, + cpu_sql_nanos FLOAT8 NULL AS ((((statistics->'execution_statistics':::STRING)->'cpuSQLNanos':::STRING)->'mean':::STRING)::FLOAT8) STORED, + contention_time FLOAT8 NULL AS ((((statistics->'execution_statistics':::STRING)->'contentionTime':::STRING)->'mean':::STRING)::FLOAT8) STORED, + total_estimated_execution_time FLOAT8 NULL AS (((statistics->'statistics':::STRING)->'cnt':::STRING)::FLOAT8 * (((statistics->'statistics':::STRING)->'svcLat':::STRING)->>'mean':::STRING)::FLOAT8) STORED, CONSTRAINT "primary" PRIMARY KEY (aggregated_ts ASC, fingerprint_id ASC, app_name ASC, node_id ASC) USING HASH WITH (bucket_count=8), - INDEX fingerprint_stats_idx (fingerprint_id ASC) + INDEX fingerprint_stats_idx (fingerprint_id ASC), + INDEX execution_count_idx (aggregated_ts ASC, app_name ASC, execution_count DESC) WHERE app_name NOT LIKE '$ internal%':::STRING, + INDEX service_latency_idx (aggregated_ts ASC, app_name ASC, service_latency DESC) WHERE app_name NOT LIKE '$ internal%':::STRING, + INDEX cpu_sql_nanos_idx (aggregated_ts ASC, app_name ASC, cpu_sql_nanos DESC) WHERE app_name NOT LIKE '$ internal%':::STRING, + INDEX contention_time_idx (aggregated_ts ASC, app_name ASC, contention_time DESC) WHERE app_name NOT LIKE '$ internal%':::STRING, + INDEX total_estimated_execution_time_idx (aggregated_ts ASC, app_name ASC, total_estimated_execution_time DESC) WHERE app_name NOT LIKE '$ internal%':::STRING ); CREATE TABLE public.database_role_settings ( database_id OID NOT NULL, @@ -514,14 +534,14 @@ schema_telemetry {"table":{"name":"statement_bundle_chunks","id":34,"version":"1","modificationTime":{"wallTime":"0"},"parentId":1,"unexposedParentSchemaId":29,"columns":[{"name":"id","id":1,"type":{"family":"IntFamily","width":64,"oid":20},"defaultExpr":"unique_rowid()"},{"name":"description","id":2,"type":{"family":"StringFamily","oid":25},"nullable":true},{"name":"data","id":3,"type":{"family":"BytesFamily","oid":17}}],"nextColumnId":4,"families":[{"name":"primary","columnNames":["id","description","data"],"columnIds":[1,2,3]}],"nextFamilyId":1,"primaryIndex":{"name":"primary","id":1,"unique":true,"version":4,"keyColumnNames":["id"],"keyColumnDirections":["ASC"],"storeColumnNames":["description","data"],"keyColumnIds":[1],"storeColumnIds":[2,3],"foreignKey":{},"interleave":{},"partitioning":{},"encodingType":1,"sharded":{},"geoConfig":{},"constraintId":1},"nextIndexId":2,"privileges":{"users":[{"userProto":"admin","privileges":"480","withGrantOption":"480"},{"userProto":"root","privileges":"480","withGrantOption":"480"}],"ownerProto":"node","version":2},"nextMutationId":1,"formatVersion":3,"replacementOf":{"time":{}},"createAsOfTime":{"wallTime":"0"},"nextConstraintId":2}} {"table":{"name":"statement_diagnostics","id":36,"version":"1","modificationTime":{"wallTime":"0"},"parentId":1,"unexposedParentSchemaId":29,"columns":[{"name":"id","id":1,"type":{"family":"IntFamily","width":64,"oid":20},"defaultExpr":"unique_rowid()"},{"name":"statement_fingerprint","id":2,"type":{"family":"StringFamily","oid":25}},{"name":"statement","id":3,"type":{"family":"StringFamily","oid":25}},{"name":"collected_at","id":4,"type":{"family":"TimestampTZFamily","oid":1184}},{"name":"trace","id":5,"type":{"family":"JsonFamily","oid":3802},"nullable":true},{"name":"bundle_chunks","id":6,"type":{"family":"ArrayFamily","width":64,"arrayElemType":"IntFamily","oid":1016,"arrayContents":{"family":"IntFamily","width":64,"oid":20}},"nullable":true},{"name":"error","id":7,"type":{"family":"StringFamily","oid":25},"nullable":true}],"nextColumnId":8,"families":[{"name":"primary","columnNames":["id","statement_fingerprint","statement","collected_at","trace","bundle_chunks","error"],"columnIds":[1,2,3,4,5,6,7]}],"nextFamilyId":1,"primaryIndex":{"name":"primary","id":1,"unique":true,"version":4,"keyColumnNames":["id"],"keyColumnDirections":["ASC"],"storeColumnNames":["statement_fingerprint","statement","collected_at","trace","bundle_chunks","error"],"keyColumnIds":[1],"storeColumnIds":[2,3,4,5,6,7],"foreignKey":{},"interleave":{},"partitioning":{},"encodingType":1,"sharded":{},"geoConfig":{},"constraintId":1},"nextIndexId":2,"privileges":{"users":[{"userProto":"admin","privileges":"480","withGrantOption":"480"},{"userProto":"root","privileges":"480","withGrantOption":"480"}],"ownerProto":"node","version":2},"nextMutationId":1,"formatVersion":3,"replacementOf":{"time":{}},"createAsOfTime":{"wallTime":"0"},"nextConstraintId":2}} {"table":{"name":"statement_diagnostics_requests","id":35,"version":"1","modificationTime":{"wallTime":"0"},"parentId":1,"unexposedParentSchemaId":29,"columns":[{"name":"id","id":1,"type":{"family":"IntFamily","width":64,"oid":20},"defaultExpr":"unique_rowid()"},{"name":"completed","id":2,"type":{"oid":16},"defaultExpr":"false"},{"name":"statement_fingerprint","id":3,"type":{"family":"StringFamily","oid":25}},{"name":"statement_diagnostics_id","id":4,"type":{"family":"IntFamily","width":64,"oid":20},"nullable":true},{"name":"requested_at","id":5,"type":{"family":"TimestampTZFamily","oid":1184}},{"name":"min_execution_latency","id":6,"type":{"family":"IntervalFamily","oid":1186,"intervalDurationField":{}},"nullable":true},{"name":"expires_at","id":7,"type":{"family":"TimestampTZFamily","oid":1184},"nullable":true},{"name":"sampling_probability","id":8,"type":{"family":"FloatFamily","width":64,"oid":701},"nullable":true}],"nextColumnId":9,"families":[{"name":"primary","columnNames":["id","completed","statement_fingerprint","statement_diagnostics_id","requested_at","min_execution_latency","expires_at","sampling_probability"],"columnIds":[1,2,3,4,5,6,7,8]}],"nextFamilyId":1,"primaryIndex":{"name":"primary","id":1,"unique":true,"version":4,"keyColumnNames":["id"],"keyColumnDirections":["ASC"],"storeColumnNames":["completed","statement_fingerprint","statement_diagnostics_id","requested_at","min_execution_latency","expires_at","sampling_probability"],"keyColumnIds":[1],"storeColumnIds":[2,3,4,5,6,7,8],"foreignKey":{},"interleave":{},"partitioning":{},"encodingType":1,"sharded":{},"geoConfig":{},"constraintId":1},"indexes":[{"name":"completed_idx","id":2,"version":3,"keyColumnNames":["completed","id"],"keyColumnDirections":["ASC","ASC"],"storeColumnNames":["statement_fingerprint","min_execution_latency","expires_at","sampling_probability"],"keyColumnIds":[2,1],"storeColumnIds":[3,6,7,8],"foreignKey":{},"interleave":{},"partitioning":{},"sharded":{},"geoConfig":{}}],"nextIndexId":3,"privileges":{"users":[{"userProto":"admin","privileges":"480","withGrantOption":"480"},{"userProto":"root","privileges":"480","withGrantOption":"480"}],"ownerProto":"node","version":2},"nextMutationId":1,"formatVersion":3,"checks":[{"expr":"sampling_probability BETWEEN _:::FLOAT8 AND _:::FLOAT8","name":"check_sampling_probability","columnIds":[8],"constraintId":2}],"replacementOf":{"time":{}},"createAsOfTime":{"wallTime":"0"},"nextConstraintId":3}} -{"table":{"name":"statement_statistics","id":42,"version":"1","modificationTime":{"wallTime":"0"},"parentId":1,"unexposedParentSchemaId":29,"columns":[{"name":"aggregated_ts","id":1,"type":{"family":"TimestampTZFamily","oid":1184}},{"name":"fingerprint_id","id":2,"type":{"family":"BytesFamily","oid":17}},{"name":"transaction_fingerprint_id","id":3,"type":{"family":"BytesFamily","oid":17}},{"name":"plan_hash","id":4,"type":{"family":"BytesFamily","oid":17}},{"name":"app_name","id":5,"type":{"family":"StringFamily","oid":25}},{"name":"node_id","id":6,"type":{"family":"IntFamily","width":64,"oid":20}},{"name":"agg_interval","id":7,"type":{"family":"IntervalFamily","oid":1186,"intervalDurationField":{}}},{"name":"metadata","id":8,"type":{"family":"JsonFamily","oid":3802}},{"name":"statistics","id":9,"type":{"family":"JsonFamily","oid":3802}},{"name":"plan","id":10,"type":{"family":"JsonFamily","oid":3802}},{"name":"crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_plan_hash_transaction_fingerprint_id_shard_8","id":11,"type":{"family":"IntFamily","width":32,"oid":23},"hidden":true,"computeExpr":"mod(fnv32(crdb_internal.datums_to_bytes(aggregated_ts, app_name, fingerprint_id, node_id, plan_hash, transaction_fingerprint_id)), _:::INT8)"},{"name":"index_recommendations","id":12,"type":{"family":"ArrayFamily","arrayElemType":"StringFamily","oid":1009,"arrayContents":{"family":"StringFamily","oid":25}},"defaultExpr":"ARRAY[]:::STRING[]"},{"name":"indexes_usage","id":13,"type":{"family":"JsonFamily","oid":3802},"nullable":true,"computeExpr":"(statistics-\u003e'_':::STRING)-\u003e'_':::STRING","virtual":true}],"nextColumnId":14,"families":[{"name":"primary","columnNames":["crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_plan_hash_transaction_fingerprint_id_shard_8","aggregated_ts","fingerprint_id","transaction_fingerprint_id","plan_hash","app_name","node_id","agg_interval","metadata","statistics","plan","index_recommendations"],"columnIds":[11,1,2,3,4,5,6,7,8,9,10,12]}],"nextFamilyId":1,"primaryIndex":{"name":"primary","id":1,"unique":true,"version":4,"keyColumnNames":["crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_plan_hash_transaction_fingerprint_id_shard_8","aggregated_ts","fingerprint_id","transaction_fingerprint_id","plan_hash","app_name","node_id"],"keyColumnDirections":["ASC","ASC","ASC","ASC","ASC","ASC","ASC"],"storeColumnNames":["agg_interval","metadata","statistics","plan","index_recommendations"],"keyColumnIds":[11,1,2,3,4,5,6],"storeColumnIds":[7,8,9,10,12],"foreignKey":{},"interleave":{},"partitioning":{},"encodingType":1,"sharded":{"isSharded":true,"name":"crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_plan_hash_transaction_fingerprint_id_shard_8","shardBuckets":8,"columnNames":["aggregated_ts","app_name","fingerprint_id","node_id","plan_hash","transaction_fingerprint_id"]},"geoConfig":{},"constraintId":1},"indexes":[{"name":"fingerprint_stats_idx","id":2,"version":3,"keyColumnNames":["fingerprint_id","transaction_fingerprint_id"],"keyColumnDirections":["ASC","ASC"],"keyColumnIds":[2,3],"keySuffixColumnIds":[11,1,4,5,6],"foreignKey":{},"interleave":{},"partitioning":{},"sharded":{},"geoConfig":{}},{"name":"indexes_usage_idx","id":3,"version":3,"keyColumnNames":["indexes_usage"],"keyColumnDirections":["ASC"],"invertedColumnKinds":["DEFAULT"],"keyColumnIds":[13],"keySuffixColumnIds":[11,1,2,3,4,5,6],"foreignKey":{},"interleave":{},"partitioning":{},"type":"INVERTED","sharded":{},"geoConfig":{}}],"nextIndexId":4,"privileges":{"users":[{"userProto":"admin","privileges":"32","withGrantOption":"32"},{"userProto":"root","privileges":"32","withGrantOption":"32"}],"ownerProto":"node","version":2},"nextMutationId":1,"formatVersion":3,"checks":[{"expr":"crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_plan_hash_transaction_fingerprint_id_shard_8 IN (_:::INT8, _:::INT8, _:::INT8, _:::INT8, _:::INT8, _:::INT8, _:::INT8, _:::INT8)","name":"check_crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_plan_hash_transaction_fingerprint_id_shard_8","columnIds":[11],"fromHashShardedColumn":true,"constraintId":2}],"replacementOf":{"time":{}},"createAsOfTime":{"wallTime":"0"},"nextConstraintId":3}} +{"table":{"name":"statement_statistics","id":42,"version":"1","modificationTime":{"wallTime":"0"},"parentId":1,"unexposedParentSchemaId":29,"columns":[{"name":"aggregated_ts","id":1,"type":{"family":"TimestampTZFamily","oid":1184}},{"name":"fingerprint_id","id":2,"type":{"family":"BytesFamily","oid":17}},{"name":"transaction_fingerprint_id","id":3,"type":{"family":"BytesFamily","oid":17}},{"name":"plan_hash","id":4,"type":{"family":"BytesFamily","oid":17}},{"name":"app_name","id":5,"type":{"family":"StringFamily","oid":25}},{"name":"node_id","id":6,"type":{"family":"IntFamily","width":64,"oid":20}},{"name":"agg_interval","id":7,"type":{"family":"IntervalFamily","oid":1186,"intervalDurationField":{}}},{"name":"metadata","id":8,"type":{"family":"JsonFamily","oid":3802}},{"name":"statistics","id":9,"type":{"family":"JsonFamily","oid":3802}},{"name":"plan","id":10,"type":{"family":"JsonFamily","oid":3802}},{"name":"crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_plan_hash_transaction_fingerprint_id_shard_8","id":11,"type":{"family":"IntFamily","width":32,"oid":23},"hidden":true,"computeExpr":"mod(fnv32(crdb_internal.datums_to_bytes(aggregated_ts, app_name, fingerprint_id, node_id, plan_hash, transaction_fingerprint_id)), _:::INT8)"},{"name":"index_recommendations","id":12,"type":{"family":"ArrayFamily","arrayElemType":"StringFamily","oid":1009,"arrayContents":{"family":"StringFamily","oid":25}},"defaultExpr":"ARRAY[]:::STRING[]"},{"name":"indexes_usage","id":13,"type":{"family":"JsonFamily","oid":3802},"nullable":true,"computeExpr":"(statistics-\u003e'_':::STRING)-\u003e'_':::STRING","virtual":true},{"name":"execution_count","id":14,"type":{"family":"IntFamily","width":64,"oid":20},"nullable":true,"computeExpr":"((statistics-\u003e'_':::STRING)-\u003e'_':::STRING)::INT8"},{"name":"service_latency","id":15,"type":{"family":"FloatFamily","width":64,"oid":701},"nullable":true,"computeExpr":"(((statistics-\u003e'_':::STRING)-\u003e'_':::STRING)-\u003e'_':::STRING)::FLOAT8"},{"name":"cpu_sql_nanos","id":16,"type":{"family":"FloatFamily","width":64,"oid":701},"nullable":true,"computeExpr":"(((statistics-\u003e'_':::STRING)-\u003e'_':::STRING)-\u003e'_':::STRING)::FLOAT8"},{"name":"contention_time","id":17,"type":{"family":"FloatFamily","width":64,"oid":701},"nullable":true,"computeExpr":"(((statistics-\u003e'_':::STRING)-\u003e'_':::STRING)-\u003e'_':::STRING)::FLOAT8"},{"name":"total_estimated_execution_time","id":18,"type":{"family":"FloatFamily","width":64,"oid":701},"nullable":true,"computeExpr":"((statistics-\u003e'_':::STRING)-\u003e'_':::STRING)::FLOAT8 * (((statistics-\u003e'_':::STRING)-\u003e'_':::STRING)-\u003e\u003e'_':::STRING)::FLOAT8"}],"nextColumnId":19,"families":[{"name":"primary","columnNames":["crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_plan_hash_transaction_fingerprint_id_shard_8","aggregated_ts","fingerprint_id","transaction_fingerprint_id","plan_hash","app_name","node_id","agg_interval","metadata","statistics","plan","index_recommendations","execution_count","service_latency","cpu_sql_nanos","contention_time","total_estimated_execution_time"],"columnIds":[11,1,2,3,4,5,6,7,8,9,10,12,14,15,16,17,18]}],"nextFamilyId":1,"primaryIndex":{"name":"primary","id":1,"unique":true,"version":4,"keyColumnNames":["crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_plan_hash_transaction_fingerprint_id_shard_8","aggregated_ts","fingerprint_id","transaction_fingerprint_id","plan_hash","app_name","node_id"],"keyColumnDirections":["ASC","ASC","ASC","ASC","ASC","ASC","ASC"],"storeColumnNames":["agg_interval","metadata","statistics","plan","index_recommendations","execution_count","service_latency","cpu_sql_nanos","contention_time","total_estimated_execution_time"],"keyColumnIds":[11,1,2,3,4,5,6],"storeColumnIds":[7,8,9,10,12,14,15,16,17,18],"foreignKey":{},"interleave":{},"partitioning":{},"encodingType":1,"sharded":{"isSharded":true,"name":"crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_plan_hash_transaction_fingerprint_id_shard_8","shardBuckets":8,"columnNames":["aggregated_ts","app_name","fingerprint_id","node_id","plan_hash","transaction_fingerprint_id"]},"geoConfig":{},"constraintId":1},"indexes":[{"name":"fingerprint_stats_idx","id":2,"version":3,"keyColumnNames":["fingerprint_id","transaction_fingerprint_id"],"keyColumnDirections":["ASC","ASC"],"keyColumnIds":[2,3],"keySuffixColumnIds":[11,1,4,5,6],"foreignKey":{},"interleave":{},"partitioning":{},"sharded":{},"geoConfig":{}},{"name":"indexes_usage_idx","id":3,"version":3,"keyColumnNames":["indexes_usage"],"keyColumnDirections":["ASC"],"invertedColumnKinds":["DEFAULT"],"keyColumnIds":[13],"keySuffixColumnIds":[11,1,2,3,4,5,6],"foreignKey":{},"interleave":{},"partitioning":{},"type":"INVERTED","sharded":{},"geoConfig":{}},{"name":"execution_count_idx","id":4,"version":3,"keyColumnNames":["aggregated_ts","app_name","execution_count"],"keyColumnDirections":["ASC","ASC","DESC"],"keyColumnIds":[1,5,14],"keySuffixColumnIds":[11,2,3,4,6],"foreignKey":{},"interleave":{},"partitioning":{},"sharded":{},"geoConfig":{},"predicate":"app_name NOT LIKE '_':::STRING"},{"name":"service_latency_idx","id":5,"version":3,"keyColumnNames":["aggregated_ts","app_name","service_latency"],"keyColumnDirections":["ASC","ASC","DESC"],"keyColumnIds":[1,5,15],"keySuffixColumnIds":[11,2,3,4,6],"compositeColumnIds":[15],"foreignKey":{},"interleave":{},"partitioning":{},"sharded":{},"geoConfig":{},"predicate":"app_name NOT LIKE '_':::STRING"},{"name":"cpu_sql_nanos_idx","id":6,"version":3,"keyColumnNames":["aggregated_ts","app_name","cpu_sql_nanos"],"keyColumnDirections":["ASC","ASC","DESC"],"keyColumnIds":[1,5,16],"keySuffixColumnIds":[11,2,3,4,6],"compositeColumnIds":[16],"foreignKey":{},"interleave":{},"partitioning":{},"sharded":{},"geoConfig":{},"predicate":"app_name NOT LIKE '_':::STRING"},{"name":"contention_time_idx","id":7,"version":3,"keyColumnNames":["aggregated_ts","app_name","contention_time"],"keyColumnDirections":["ASC","ASC","DESC"],"keyColumnIds":[1,5,17],"keySuffixColumnIds":[11,2,3,4,6],"compositeColumnIds":[17],"foreignKey":{},"interleave":{},"partitioning":{},"sharded":{},"geoConfig":{},"predicate":"app_name NOT LIKE '_':::STRING"},{"name":"total_estimated_execution_time_idx","id":8,"version":3,"keyColumnNames":["aggregated_ts","app_name","total_estimated_execution_time"],"keyColumnDirections":["ASC","ASC","DESC"],"keyColumnIds":[1,5,18],"keySuffixColumnIds":[11,2,3,4,6],"compositeColumnIds":[18],"foreignKey":{},"interleave":{},"partitioning":{},"sharded":{},"geoConfig":{},"predicate":"app_name NOT LIKE '_':::STRING"}],"nextIndexId":9,"privileges":{"users":[{"userProto":"admin","privileges":"32","withGrantOption":"32"},{"userProto":"root","privileges":"32","withGrantOption":"32"}],"ownerProto":"node","version":2},"nextMutationId":1,"formatVersion":3,"checks":[{"expr":"crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_plan_hash_transaction_fingerprint_id_shard_8 IN (_:::INT8, _:::INT8, _:::INT8, _:::INT8, _:::INT8, _:::INT8, _:::INT8, _:::INT8)","name":"check_crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_plan_hash_transaction_fingerprint_id_shard_8","columnIds":[11],"fromHashShardedColumn":true,"constraintId":2}],"replacementOf":{"time":{}},"createAsOfTime":{"wallTime":"0"},"nextConstraintId":3}} {"table":{"name":"table_statistics","id":20,"version":"1","modificationTime":{"wallTime":"0"},"parentId":1,"unexposedParentSchemaId":29,"columns":[{"name":"tableID","id":1,"type":{"family":"IntFamily","width":64,"oid":20}},{"name":"statisticID","id":2,"type":{"family":"IntFamily","width":64,"oid":20},"defaultExpr":"unique_rowid()"},{"name":"name","id":3,"type":{"family":"StringFamily","oid":25},"nullable":true},{"name":"columnIDs","id":4,"type":{"family":"ArrayFamily","width":64,"arrayElemType":"IntFamily","oid":1016,"arrayContents":{"family":"IntFamily","width":64,"oid":20}}},{"name":"createdAt","id":5,"type":{"family":"TimestampFamily","oid":1114},"defaultExpr":"now():::TIMESTAMP"},{"name":"rowCount","id":6,"type":{"family":"IntFamily","width":64,"oid":20}},{"name":"distinctCount","id":7,"type":{"family":"IntFamily","width":64,"oid":20}},{"name":"nullCount","id":8,"type":{"family":"IntFamily","width":64,"oid":20}},{"name":"histogram","id":9,"type":{"family":"BytesFamily","oid":17},"nullable":true},{"name":"avgSize","id":10,"type":{"family":"IntFamily","width":64,"oid":20},"defaultExpr":"_:::INT8"},{"name":"partialPredicate","id":11,"type":{"family":"StringFamily","oid":25},"nullable":true},{"name":"fullStatisticID","id":12,"type":{"family":"IntFamily","width":64,"oid":20},"nullable":true}],"nextColumnId":13,"families":[{"name":"fam_0_tableID_statisticID_name_columnIDs_createdAt_rowCount_distinctCount_nullCount_histogram","columnNames":["tableID","statisticID","name","columnIDs","createdAt","rowCount","distinctCount","nullCount","histogram","avgSize","partialPredicate","fullStatisticID"],"columnIds":[1,2,3,4,5,6,7,8,9,10,11,12]}],"nextFamilyId":1,"primaryIndex":{"name":"primary","id":1,"unique":true,"version":4,"keyColumnNames":["tableID","statisticID"],"keyColumnDirections":["ASC","ASC"],"storeColumnNames":["name","columnIDs","createdAt","rowCount","distinctCount","nullCount","histogram","avgSize","partialPredicate","fullStatisticID"],"keyColumnIds":[1,2],"storeColumnIds":[3,4,5,6,7,8,9,10,11,12],"foreignKey":{},"interleave":{},"partitioning":{},"encodingType":1,"sharded":{},"geoConfig":{},"constraintId":1},"nextIndexId":2,"privileges":{"users":[{"userProto":"admin","privileges":"480","withGrantOption":"480"},{"userProto":"root","privileges":"480","withGrantOption":"480"}],"ownerProto":"node","version":2},"nextMutationId":1,"formatVersion":3,"replacementOf":{"time":{}},"createAsOfTime":{"wallTime":"0"},"nextConstraintId":2}} {"table":{"name":"task_payloads","id":58,"version":"1","modificationTime":{"wallTime":"0"},"parentId":1,"unexposedParentSchemaId":29,"columns":[{"name":"id","id":1,"type":{"family":"StringFamily","oid":25}},{"name":"created","id":2,"type":{"family":"TimestampTZFamily","oid":1184},"defaultExpr":"now():::TIMESTAMPTZ"},{"name":"owner","id":3,"type":{"family":"StringFamily","oid":25}},{"name":"owner_id","id":4,"type":{"family":"OidFamily","oid":26}},{"name":"min_version","id":5,"type":{"family":"StringFamily","oid":25}},{"name":"description","id":6,"type":{"family":"StringFamily","oid":25},"nullable":true},{"name":"type","id":7,"type":{"family":"StringFamily","oid":25}},{"name":"value","id":8,"type":{"family":"BytesFamily","oid":17}}],"nextColumnId":9,"families":[{"name":"primary","columnNames":["id","created","owner","owner_id","min_version","description","type","value"],"columnIds":[1,2,3,4,5,6,7,8]}],"nextFamilyId":1,"primaryIndex":{"name":"primary","id":1,"unique":true,"version":4,"keyColumnNames":["id"],"keyColumnDirections":["ASC"],"storeColumnNames":["created","owner","owner_id","min_version","description","type","value"],"keyColumnIds":[1],"storeColumnIds":[2,3,4,5,6,7,8],"foreignKey":{},"interleave":{},"partitioning":{},"encodingType":1,"sharded":{},"geoConfig":{},"constraintId":1},"nextIndexId":2,"privileges":{"users":[{"userProto":"admin","privileges":"480","withGrantOption":"480"},{"userProto":"root","privileges":"480","withGrantOption":"480"}],"ownerProto":"node","version":2},"nextMutationId":1,"formatVersion":3,"replacementOf":{"time":{}},"createAsOfTime":{"wallTime":"0"},"nextConstraintId":2}} {"table":{"name":"tenant_settings","id":50,"version":"1","modificationTime":{"wallTime":"0"},"parentId":1,"unexposedParentSchemaId":29,"columns":[{"name":"tenant_id","id":1,"type":{"family":"IntFamily","width":64,"oid":20}},{"name":"name","id":2,"type":{"family":"StringFamily","oid":25}},{"name":"value","id":3,"type":{"family":"StringFamily","oid":25}},{"name":"last_updated","id":4,"type":{"family":"TimestampFamily","oid":1114},"defaultExpr":"now():::TIMESTAMP"},{"name":"value_type","id":5,"type":{"family":"StringFamily","oid":25}},{"name":"reason","id":6,"type":{"family":"StringFamily","oid":25},"nullable":true}],"nextColumnId":7,"families":[{"name":"fam_0_tenant_id_name_value_last_updated_value_type_reason","columnNames":["tenant_id","name","value","last_updated","value_type","reason"],"columnIds":[1,2,3,4,5,6]}],"nextFamilyId":1,"primaryIndex":{"name":"primary","id":1,"unique":true,"version":4,"keyColumnNames":["tenant_id","name"],"keyColumnDirections":["ASC","ASC"],"storeColumnNames":["value","last_updated","value_type","reason"],"keyColumnIds":[1,2],"storeColumnIds":[3,4,5,6],"foreignKey":{},"interleave":{},"partitioning":{},"encodingType":1,"sharded":{},"geoConfig":{},"constraintId":1},"nextIndexId":2,"privileges":{"users":[{"userProto":"admin","privileges":"480","withGrantOption":"480"},{"userProto":"root","privileges":"480","withGrantOption":"480"}],"ownerProto":"node","version":2},"nextMutationId":1,"formatVersion":3,"replacementOf":{"time":{}},"createAsOfTime":{"wallTime":"0"},"nextConstraintId":2}} {"table":{"name":"tenant_tasks","id":59,"version":"1","modificationTime":{"wallTime":"0"},"parentId":1,"unexposedParentSchemaId":29,"columns":[{"name":"tenant_id","id":1,"type":{"family":"IntFamily","width":64,"oid":20}},{"name":"issuer","id":2,"type":{"family":"StringFamily","oid":25}},{"name":"task_id","id":3,"type":{"family":"IntFamily","width":64,"oid":20}},{"name":"created","id":4,"type":{"family":"TimestampTZFamily","oid":1184},"defaultExpr":"now():::TIMESTAMPTZ"},{"name":"payload_id","id":5,"type":{"family":"StringFamily","oid":25}},{"name":"owner","id":6,"type":{"family":"StringFamily","oid":25}},{"name":"owner_id","id":7,"type":{"family":"OidFamily","oid":26}}],"nextColumnId":8,"families":[{"name":"primary","columnNames":["tenant_id","issuer","task_id","created","payload_id","owner","owner_id"],"columnIds":[1,2,3,4,5,6,7]}],"nextFamilyId":1,"primaryIndex":{"name":"primary","id":1,"unique":true,"version":4,"keyColumnNames":["tenant_id","issuer","task_id"],"keyColumnDirections":["ASC","ASC","ASC"],"storeColumnNames":["created","payload_id","owner","owner_id"],"keyColumnIds":[1,2,3],"storeColumnIds":[4,5,6,7],"foreignKey":{},"interleave":{},"partitioning":{},"encodingType":1,"sharded":{},"geoConfig":{},"constraintId":1},"nextIndexId":2,"privileges":{"users":[{"userProto":"admin","privileges":"480","withGrantOption":"480"},{"userProto":"root","privileges":"480","withGrantOption":"480"}],"ownerProto":"node","version":2},"nextMutationId":1,"formatVersion":3,"replacementOf":{"time":{}},"createAsOfTime":{"wallTime":"0"},"nextConstraintId":2}} {"table":{"name":"tenant_usage","id":45,"version":"1","modificationTime":{"wallTime":"0"},"parentId":1,"unexposedParentSchemaId":29,"columns":[{"name":"tenant_id","id":1,"type":{"family":"IntFamily","width":64,"oid":20}},{"name":"instance_id","id":2,"type":{"family":"IntFamily","width":64,"oid":20}},{"name":"next_instance_id","id":3,"type":{"family":"IntFamily","width":64,"oid":20}},{"name":"last_update","id":4,"type":{"family":"TimestampFamily","oid":1114}},{"name":"ru_burst_limit","id":5,"type":{"family":"FloatFamily","width":64,"oid":701},"nullable":true},{"name":"ru_refill_rate","id":6,"type":{"family":"FloatFamily","width":64,"oid":701},"nullable":true},{"name":"ru_current","id":7,"type":{"family":"FloatFamily","width":64,"oid":701},"nullable":true},{"name":"current_share_sum","id":8,"type":{"family":"FloatFamily","width":64,"oid":701},"nullable":true},{"name":"total_consumption","id":9,"type":{"family":"BytesFamily","oid":17},"nullable":true},{"name":"instance_lease","id":10,"type":{"family":"BytesFamily","oid":17},"nullable":true},{"name":"instance_seq","id":11,"type":{"family":"IntFamily","width":64,"oid":20},"nullable":true},{"name":"instance_shares","id":12,"type":{"family":"FloatFamily","width":64,"oid":701},"nullable":true}],"nextColumnId":13,"families":[{"name":"primary","columnNames":["tenant_id","instance_id","next_instance_id","last_update","ru_burst_limit","ru_refill_rate","ru_current","current_share_sum","total_consumption","instance_lease","instance_seq","instance_shares"],"columnIds":[1,2,3,4,5,6,7,8,9,10,11,12]}],"nextFamilyId":1,"primaryIndex":{"name":"primary","id":1,"unique":true,"version":4,"keyColumnNames":["tenant_id","instance_id"],"keyColumnDirections":["ASC","ASC"],"storeColumnNames":["next_instance_id","last_update","ru_burst_limit","ru_refill_rate","ru_current","current_share_sum","total_consumption","instance_lease","instance_seq","instance_shares"],"keyColumnIds":[1,2],"storeColumnIds":[3,4,5,6,7,8,9,10,11,12],"foreignKey":{},"interleave":{},"partitioning":{},"encodingType":1,"sharded":{},"geoConfig":{},"constraintId":1},"nextIndexId":2,"privileges":{"users":[{"userProto":"admin","privileges":"480","withGrantOption":"480"},{"userProto":"root","privileges":"480","withGrantOption":"480"}],"ownerProto":"node","version":2},"nextMutationId":1,"formatVersion":3,"replacementOf":{"time":{}},"createAsOfTime":{"wallTime":"0"},"nextConstraintId":2}} {"table":{"name":"tenants","id":8,"version":"1","modificationTime":{"wallTime":"0"},"parentId":1,"unexposedParentSchemaId":29,"columns":[{"name":"id","id":1,"type":{"family":"IntFamily","width":64,"oid":20}},{"name":"active","id":2,"type":{"oid":16},"defaultExpr":"true","hidden":true},{"name":"info","id":3,"type":{"family":"BytesFamily","oid":17},"nullable":true},{"name":"name","id":4,"type":{"family":"StringFamily","oid":25},"nullable":true},{"name":"data_state","id":5,"type":{"family":"IntFamily","width":64,"oid":20},"nullable":true},{"name":"service_mode","id":6,"type":{"family":"IntFamily","width":64,"oid":20},"nullable":true}],"nextColumnId":7,"families":[{"name":"primary","columnNames":["id","active","info","name","data_state","service_mode"],"columnIds":[1,2,3,4,5,6]}],"nextFamilyId":1,"primaryIndex":{"name":"primary","id":1,"unique":true,"version":4,"keyColumnNames":["id"],"keyColumnDirections":["ASC"],"storeColumnNames":["active","info","name","data_state","service_mode"],"keyColumnIds":[1],"storeColumnIds":[2,3,4,5,6],"foreignKey":{},"interleave":{},"partitioning":{},"encodingType":1,"sharded":{},"geoConfig":{},"constraintId":2},"indexes":[{"name":"tenants_name_idx","id":2,"unique":true,"version":3,"keyColumnNames":["name"],"keyColumnDirections":["ASC"],"keyColumnIds":[4],"keySuffixColumnIds":[1],"foreignKey":{},"interleave":{},"partitioning":{},"sharded":{},"geoConfig":{},"constraintId":1},{"name":"tenants_service_mode_idx","id":3,"version":3,"keyColumnNames":["service_mode"],"keyColumnDirections":["ASC"],"keyColumnIds":[6],"keySuffixColumnIds":[1],"foreignKey":{},"interleave":{},"partitioning":{},"sharded":{},"geoConfig":{}}],"nextIndexId":4,"privileges":{"users":[{"userProto":"admin","privileges":"32","withGrantOption":"32"},{"userProto":"root","privileges":"32","withGrantOption":"32"}],"ownerProto":"node","version":2},"nextMutationId":1,"formatVersion":3,"replacementOf":{"time":{}},"createAsOfTime":{"wallTime":"0"},"nextConstraintId":3}} -{"table":{"name":"transaction_statistics","id":43,"version":"1","modificationTime":{"wallTime":"0"},"parentId":1,"unexposedParentSchemaId":29,"columns":[{"name":"aggregated_ts","id":1,"type":{"family":"TimestampTZFamily","oid":1184}},{"name":"fingerprint_id","id":2,"type":{"family":"BytesFamily","oid":17}},{"name":"app_name","id":3,"type":{"family":"StringFamily","oid":25}},{"name":"node_id","id":4,"type":{"family":"IntFamily","width":64,"oid":20}},{"name":"agg_interval","id":5,"type":{"family":"IntervalFamily","oid":1186,"intervalDurationField":{}}},{"name":"metadata","id":6,"type":{"family":"JsonFamily","oid":3802}},{"name":"statistics","id":7,"type":{"family":"JsonFamily","oid":3802}},{"name":"crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_shard_8","id":8,"type":{"family":"IntFamily","width":32,"oid":23},"hidden":true,"computeExpr":"mod(fnv32(crdb_internal.datums_to_bytes(aggregated_ts, app_name, fingerprint_id, node_id)), _:::INT8)"}],"nextColumnId":9,"families":[{"name":"primary","columnNames":["crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_shard_8","aggregated_ts","fingerprint_id","app_name","node_id","agg_interval","metadata","statistics"],"columnIds":[8,1,2,3,4,5,6,7]}],"nextFamilyId":1,"primaryIndex":{"name":"primary","id":1,"unique":true,"version":4,"keyColumnNames":["crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_shard_8","aggregated_ts","fingerprint_id","app_name","node_id"],"keyColumnDirections":["ASC","ASC","ASC","ASC","ASC"],"storeColumnNames":["agg_interval","metadata","statistics"],"keyColumnIds":[8,1,2,3,4],"storeColumnIds":[5,6,7],"foreignKey":{},"interleave":{},"partitioning":{},"encodingType":1,"sharded":{"isSharded":true,"name":"crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_shard_8","shardBuckets":8,"columnNames":["aggregated_ts","app_name","fingerprint_id","node_id"]},"geoConfig":{},"constraintId":1},"indexes":[{"name":"fingerprint_stats_idx","id":2,"version":3,"keyColumnNames":["fingerprint_id"],"keyColumnDirections":["ASC"],"keyColumnIds":[2],"keySuffixColumnIds":[8,1,3,4],"foreignKey":{},"interleave":{},"partitioning":{},"sharded":{},"geoConfig":{}}],"nextIndexId":3,"privileges":{"users":[{"userProto":"admin","privileges":"32","withGrantOption":"32"},{"userProto":"root","privileges":"32","withGrantOption":"32"}],"ownerProto":"node","version":2},"nextMutationId":1,"formatVersion":3,"checks":[{"expr":"crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_shard_8 IN (_:::INT8, _:::INT8, _:::INT8, _:::INT8, _:::INT8, _:::INT8, _:::INT8, _:::INT8)","name":"check_crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_shard_8","columnIds":[8],"fromHashShardedColumn":true,"constraintId":2}],"replacementOf":{"time":{}},"createAsOfTime":{"wallTime":"0"},"nextConstraintId":3}} +{"table":{"name":"transaction_statistics","id":43,"version":"1","modificationTime":{"wallTime":"0"},"parentId":1,"unexposedParentSchemaId":29,"columns":[{"name":"aggregated_ts","id":1,"type":{"family":"TimestampTZFamily","oid":1184}},{"name":"fingerprint_id","id":2,"type":{"family":"BytesFamily","oid":17}},{"name":"app_name","id":3,"type":{"family":"StringFamily","oid":25}},{"name":"node_id","id":4,"type":{"family":"IntFamily","width":64,"oid":20}},{"name":"agg_interval","id":5,"type":{"family":"IntervalFamily","oid":1186,"intervalDurationField":{}}},{"name":"metadata","id":6,"type":{"family":"JsonFamily","oid":3802}},{"name":"statistics","id":7,"type":{"family":"JsonFamily","oid":3802}},{"name":"crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_shard_8","id":8,"type":{"family":"IntFamily","width":32,"oid":23},"hidden":true,"computeExpr":"mod(fnv32(crdb_internal.datums_to_bytes(aggregated_ts, app_name, fingerprint_id, node_id)), _:::INT8)"},{"name":"execution_count","id":9,"type":{"family":"IntFamily","width":64,"oid":20},"nullable":true,"computeExpr":"((statistics-\u003e'_':::STRING)-\u003e'_':::STRING)::INT8"},{"name":"service_latency","id":10,"type":{"family":"FloatFamily","width":64,"oid":701},"nullable":true,"computeExpr":"(((statistics-\u003e'_':::STRING)-\u003e'_':::STRING)-\u003e'_':::STRING)::FLOAT8"},{"name":"cpu_sql_nanos","id":11,"type":{"family":"FloatFamily","width":64,"oid":701},"nullable":true,"computeExpr":"(((statistics-\u003e'_':::STRING)-\u003e'_':::STRING)-\u003e'_':::STRING)::FLOAT8"},{"name":"contention_time","id":12,"type":{"family":"FloatFamily","width":64,"oid":701},"nullable":true,"computeExpr":"(((statistics-\u003e'_':::STRING)-\u003e'_':::STRING)-\u003e'_':::STRING)::FLOAT8"},{"name":"total_estimated_execution_time","id":13,"type":{"family":"FloatFamily","width":64,"oid":701},"nullable":true,"computeExpr":"((statistics-\u003e'_':::STRING)-\u003e'_':::STRING)::FLOAT8 * (((statistics-\u003e'_':::STRING)-\u003e'_':::STRING)-\u003e\u003e'_':::STRING)::FLOAT8"}],"nextColumnId":14,"families":[{"name":"primary","columnNames":["crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_shard_8","aggregated_ts","fingerprint_id","app_name","node_id","agg_interval","metadata","statistics","execution_count","service_latency","cpu_sql_nanos","contention_time","total_estimated_execution_time"],"columnIds":[8,1,2,3,4,5,6,7,9,10,11,12,13]}],"nextFamilyId":1,"primaryIndex":{"name":"primary","id":1,"unique":true,"version":4,"keyColumnNames":["crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_shard_8","aggregated_ts","fingerprint_id","app_name","node_id"],"keyColumnDirections":["ASC","ASC","ASC","ASC","ASC"],"storeColumnNames":["agg_interval","metadata","statistics","execution_count","service_latency","cpu_sql_nanos","contention_time","total_estimated_execution_time"],"keyColumnIds":[8,1,2,3,4],"storeColumnIds":[5,6,7,9,10,11,12,13],"foreignKey":{},"interleave":{},"partitioning":{},"encodingType":1,"sharded":{"isSharded":true,"name":"crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_shard_8","shardBuckets":8,"columnNames":["aggregated_ts","app_name","fingerprint_id","node_id"]},"geoConfig":{},"constraintId":1},"indexes":[{"name":"fingerprint_stats_idx","id":2,"version":3,"keyColumnNames":["fingerprint_id"],"keyColumnDirections":["ASC"],"keyColumnIds":[2],"keySuffixColumnIds":[8,1,3,4],"foreignKey":{},"interleave":{},"partitioning":{},"sharded":{},"geoConfig":{}},{"name":"execution_count_idx","id":3,"version":3,"keyColumnNames":["aggregated_ts","app_name","execution_count"],"keyColumnDirections":["ASC","ASC","DESC"],"keyColumnIds":[1,3,9],"keySuffixColumnIds":[8,2,4],"foreignKey":{},"interleave":{},"partitioning":{},"sharded":{},"geoConfig":{},"predicate":"app_name NOT LIKE '_':::STRING"},{"name":"service_latency_idx","id":4,"version":3,"keyColumnNames":["aggregated_ts","app_name","service_latency"],"keyColumnDirections":["ASC","ASC","DESC"],"keyColumnIds":[1,3,10],"keySuffixColumnIds":[8,2,4],"compositeColumnIds":[10],"foreignKey":{},"interleave":{},"partitioning":{},"sharded":{},"geoConfig":{},"predicate":"app_name NOT LIKE '_':::STRING"},{"name":"cpu_sql_nanos_idx","id":5,"version":3,"keyColumnNames":["aggregated_ts","app_name","cpu_sql_nanos"],"keyColumnDirections":["ASC","ASC","DESC"],"keyColumnIds":[1,3,11],"keySuffixColumnIds":[8,2,4],"compositeColumnIds":[11],"foreignKey":{},"interleave":{},"partitioning":{},"sharded":{},"geoConfig":{},"predicate":"app_name NOT LIKE '_':::STRING"},{"name":"contention_time_idx","id":6,"version":3,"keyColumnNames":["aggregated_ts","app_name","contention_time"],"keyColumnDirections":["ASC","ASC","DESC"],"keyColumnIds":[1,3,12],"keySuffixColumnIds":[8,2,4],"compositeColumnIds":[12],"foreignKey":{},"interleave":{},"partitioning":{},"sharded":{},"geoConfig":{},"predicate":"app_name NOT LIKE '_':::STRING"},{"name":"total_estimated_execution_time_idx","id":7,"version":3,"keyColumnNames":["aggregated_ts","app_name","total_estimated_execution_time"],"keyColumnDirections":["ASC","ASC","DESC"],"keyColumnIds":[1,3,13],"keySuffixColumnIds":[8,2,4],"compositeColumnIds":[13],"foreignKey":{},"interleave":{},"partitioning":{},"sharded":{},"geoConfig":{},"predicate":"app_name NOT LIKE '_':::STRING"}],"nextIndexId":8,"privileges":{"users":[{"userProto":"admin","privileges":"32","withGrantOption":"32"},{"userProto":"root","privileges":"32","withGrantOption":"32"}],"ownerProto":"node","version":2},"nextMutationId":1,"formatVersion":3,"checks":[{"expr":"crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_shard_8 IN (_:::INT8, _:::INT8, _:::INT8, _:::INT8, _:::INT8, _:::INT8, _:::INT8, _:::INT8)","name":"check_crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_shard_8","columnIds":[8],"fromHashShardedColumn":true,"constraintId":2}],"replacementOf":{"time":{}},"createAsOfTime":{"wallTime":"0"},"nextConstraintId":3}} {"table":{"name":"ui","id":14,"version":"1","modificationTime":{"wallTime":"0"},"parentId":1,"unexposedParentSchemaId":29,"columns":[{"name":"key","id":1,"type":{"family":"StringFamily","oid":25}},{"name":"value","id":2,"type":{"family":"BytesFamily","oid":17},"nullable":true},{"name":"lastUpdated","id":3,"type":{"family":"TimestampFamily","oid":1114}}],"nextColumnId":4,"families":[{"name":"primary","columnNames":["key"],"columnIds":[1]},{"name":"fam_2_value","id":2,"columnNames":["value"],"columnIds":[2],"defaultColumnId":2},{"name":"fam_3_lastUpdated","id":3,"columnNames":["lastUpdated"],"columnIds":[3],"defaultColumnId":3}],"nextFamilyId":4,"primaryIndex":{"name":"primary","id":1,"unique":true,"version":4,"keyColumnNames":["key"],"keyColumnDirections":["ASC"],"storeColumnNames":["value","lastUpdated"],"keyColumnIds":[1],"storeColumnIds":[2,3],"foreignKey":{},"interleave":{},"partitioning":{},"encodingType":1,"sharded":{},"geoConfig":{},"constraintId":1},"nextIndexId":2,"privileges":{"users":[{"userProto":"admin","privileges":"480","withGrantOption":"480"},{"userProto":"root","privileges":"480","withGrantOption":"480"}],"ownerProto":"node","version":2},"nextMutationId":1,"formatVersion":3,"replacementOf":{"time":{}},"createAsOfTime":{"wallTime":"0"},"nextConstraintId":2}} {"table":{"name":"users","id":4,"version":"1","modificationTime":{"wallTime":"0"},"parentId":1,"unexposedParentSchemaId":29,"columns":[{"name":"username","id":1,"type":{"family":"StringFamily","oid":25}},{"name":"hashedPassword","id":2,"type":{"family":"BytesFamily","oid":17},"nullable":true},{"name":"isRole","id":3,"type":{"oid":16},"defaultExpr":"false"},{"name":"user_id","id":4,"type":{"family":"OidFamily","oid":26}}],"nextColumnId":5,"families":[{"name":"primary","columnNames":["username","user_id"],"columnIds":[1,4],"defaultColumnId":4},{"name":"fam_2_hashedPassword","id":2,"columnNames":["hashedPassword"],"columnIds":[2],"defaultColumnId":2},{"name":"fam_3_isRole","id":3,"columnNames":["isRole"],"columnIds":[3],"defaultColumnId":3}],"nextFamilyId":4,"primaryIndex":{"name":"primary","id":1,"unique":true,"version":4,"keyColumnNames":["username"],"keyColumnDirections":["ASC"],"storeColumnNames":["hashedPassword","isRole","user_id"],"keyColumnIds":[1],"storeColumnIds":[2,3,4],"foreignKey":{},"interleave":{},"partitioning":{},"encodingType":1,"sharded":{},"geoConfig":{},"constraintId":2},"indexes":[{"name":"users_user_id_idx","id":2,"unique":true,"version":3,"keyColumnNames":["user_id"],"keyColumnDirections":["ASC"],"keyColumnIds":[4],"keySuffixColumnIds":[1],"foreignKey":{},"interleave":{},"partitioning":{},"sharded":{},"geoConfig":{},"constraintId":1}],"nextIndexId":3,"privileges":{"users":[{"userProto":"admin","privileges":"480","withGrantOption":"480"},{"userProto":"root","privileges":"480","withGrantOption":"480"}],"ownerProto":"node","version":2},"nextMutationId":1,"formatVersion":3,"replacementOf":{"time":{}},"createAsOfTime":{"wallTime":"0"},"nextConstraintId":3}} {"table":{"name":"web_sessions","id":19,"version":"1","modificationTime":{"wallTime":"0"},"parentId":1,"unexposedParentSchemaId":29,"columns":[{"name":"id","id":1,"type":{"family":"IntFamily","width":64,"oid":20},"defaultExpr":"unique_rowid()"},{"name":"hashedSecret","id":2,"type":{"family":"BytesFamily","oid":17}},{"name":"username","id":3,"type":{"family":"StringFamily","oid":25}},{"name":"createdAt","id":4,"type":{"family":"TimestampFamily","oid":1114},"defaultExpr":"now():::TIMESTAMP"},{"name":"expiresAt","id":5,"type":{"family":"TimestampFamily","oid":1114}},{"name":"revokedAt","id":6,"type":{"family":"TimestampFamily","oid":1114},"nullable":true},{"name":"lastUsedAt","id":7,"type":{"family":"TimestampFamily","oid":1114},"defaultExpr":"now():::TIMESTAMP"},{"name":"auditInfo","id":8,"type":{"family":"StringFamily","oid":25},"nullable":true},{"name":"user_id","id":9,"type":{"family":"OidFamily","oid":26}}],"nextColumnId":10,"families":[{"name":"fam_0_id_hashedSecret_username_createdAt_expiresAt_revokedAt_lastUsedAt_auditInfo","columnNames":["id","hashedSecret","username","createdAt","expiresAt","revokedAt","lastUsedAt","auditInfo","user_id"],"columnIds":[1,2,3,4,5,6,7,8,9]}],"nextFamilyId":1,"primaryIndex":{"name":"primary","id":1,"unique":true,"version":4,"keyColumnNames":["id"],"keyColumnDirections":["ASC"],"storeColumnNames":["hashedSecret","username","createdAt","expiresAt","revokedAt","lastUsedAt","auditInfo","user_id"],"keyColumnIds":[1],"storeColumnIds":[2,3,4,5,6,7,8,9],"foreignKey":{},"interleave":{},"partitioning":{},"encodingType":1,"sharded":{},"geoConfig":{},"constraintId":1},"indexes":[{"name":"web_sessions_expiresAt_idx","id":2,"version":3,"keyColumnNames":["expiresAt"],"keyColumnDirections":["ASC"],"keyColumnIds":[5],"keySuffixColumnIds":[1],"foreignKey":{},"interleave":{},"partitioning":{},"sharded":{},"geoConfig":{}},{"name":"web_sessions_createdAt_idx","id":3,"version":3,"keyColumnNames":["createdAt"],"keyColumnDirections":["ASC"],"keyColumnIds":[4],"keySuffixColumnIds":[1],"foreignKey":{},"interleave":{},"partitioning":{},"sharded":{},"geoConfig":{}},{"name":"web_sessions_revokedAt_idx","id":4,"version":3,"keyColumnNames":["revokedAt"],"keyColumnDirections":["ASC"],"keyColumnIds":[6],"keySuffixColumnIds":[1],"foreignKey":{},"interleave":{},"partitioning":{},"sharded":{},"geoConfig":{}},{"name":"web_sessions_lastUsedAt_idx","id":5,"version":3,"keyColumnNames":["lastUsedAt"],"keyColumnDirections":["ASC"],"keyColumnIds":[7],"keySuffixColumnIds":[1],"foreignKey":{},"interleave":{},"partitioning":{},"sharded":{},"geoConfig":{}}],"nextIndexId":6,"privileges":{"users":[{"userProto":"admin","privileges":"480","withGrantOption":"480"},{"userProto":"root","privileges":"480","withGrantOption":"480"}],"ownerProto":"node","version":2},"nextMutationId":1,"formatVersion":3,"replacementOf":{"time":{}},"createAsOfTime":{"wallTime":"0"},"nextConstraintId":2}} @@ -540,7 +560,7 @@ schema_telemetry snapshot_id=7cd8a9ae-f35c-4cd2-970a-757174600874 max_records=10 {"table":{"name":"sql_instances","id":46,"version":"1","modificationTime":{"wallTime":"0"},"parentId":1,"unexposedParentSchemaId":29,"columns":[{"name":"id","id":1,"type":{"family":"IntFamily","width":64,"oid":20}},{"name":"addr","id":2,"type":{"family":"StringFamily","oid":25},"nullable":true},{"name":"session_id","id":3,"type":{"family":"BytesFamily","oid":17},"nullable":true},{"name":"locality","id":4,"type":{"family":"JsonFamily","oid":3802},"nullable":true},{"name":"sql_addr","id":5,"type":{"family":"StringFamily","oid":25},"nullable":true},{"name":"crdb_region","id":6,"type":{"family":"BytesFamily","oid":17}},{"name":"binary_version","id":7,"type":{"family":"StringFamily","oid":25},"nullable":true}],"nextColumnId":8,"families":[{"name":"primary","columnNames":["id","addr","session_id","locality","sql_addr","crdb_region","binary_version"],"columnIds":[1,2,3,4,5,6,7]}],"nextFamilyId":1,"primaryIndex":{"name":"primary","id":2,"unique":true,"version":4,"keyColumnNames":["crdb_region","id"],"keyColumnDirections":["ASC","ASC"],"storeColumnNames":["addr","session_id","locality","sql_addr","binary_version"],"keyColumnIds":[6,1],"storeColumnIds":[2,3,4,5,7],"foreignKey":{},"interleave":{},"partitioning":{},"encodingType":1,"sharded":{},"geoConfig":{},"constraintId":1},"nextIndexId":3,"privileges":{"users":[{"userProto":"admin","privileges":"480","withGrantOption":"480"},{"userProto":"root","privileges":"480","withGrantOption":"480"}],"ownerProto":"node","version":2},"nextMutationId":1,"formatVersion":3,"replacementOf":{"time":{}},"createAsOfTime":{"wallTime":"0"},"nextConstraintId":2}} {"table":{"name":"statement_diagnostics","id":36,"version":"1","modificationTime":{"wallTime":"0"},"parentId":1,"unexposedParentSchemaId":29,"columns":[{"name":"id","id":1,"type":{"family":"IntFamily","width":64,"oid":20},"defaultExpr":"unique_rowid()"},{"name":"statement_fingerprint","id":2,"type":{"family":"StringFamily","oid":25}},{"name":"statement","id":3,"type":{"family":"StringFamily","oid":25}},{"name":"collected_at","id":4,"type":{"family":"TimestampTZFamily","oid":1184}},{"name":"trace","id":5,"type":{"family":"JsonFamily","oid":3802},"nullable":true},{"name":"bundle_chunks","id":6,"type":{"family":"ArrayFamily","width":64,"arrayElemType":"IntFamily","oid":1016,"arrayContents":{"family":"IntFamily","width":64,"oid":20}},"nullable":true},{"name":"error","id":7,"type":{"family":"StringFamily","oid":25},"nullable":true}],"nextColumnId":8,"families":[{"name":"primary","columnNames":["id","statement_fingerprint","statement","collected_at","trace","bundle_chunks","error"],"columnIds":[1,2,3,4,5,6,7]}],"nextFamilyId":1,"primaryIndex":{"name":"primary","id":1,"unique":true,"version":4,"keyColumnNames":["id"],"keyColumnDirections":["ASC"],"storeColumnNames":["statement_fingerprint","statement","collected_at","trace","bundle_chunks","error"],"keyColumnIds":[1],"storeColumnIds":[2,3,4,5,6,7],"foreignKey":{},"interleave":{},"partitioning":{},"encodingType":1,"sharded":{},"geoConfig":{},"constraintId":1},"nextIndexId":2,"privileges":{"users":[{"userProto":"admin","privileges":"480","withGrantOption":"480"},{"userProto":"root","privileges":"480","withGrantOption":"480"}],"ownerProto":"node","version":2},"nextMutationId":1,"formatVersion":3,"replacementOf":{"time":{}},"createAsOfTime":{"wallTime":"0"},"nextConstraintId":2}} {"table":{"name":"statement_diagnostics_requests","id":35,"version":"1","modificationTime":{"wallTime":"0"},"parentId":1,"unexposedParentSchemaId":29,"columns":[{"name":"id","id":1,"type":{"family":"IntFamily","width":64,"oid":20},"defaultExpr":"unique_rowid()"},{"name":"completed","id":2,"type":{"oid":16},"defaultExpr":"false"},{"name":"statement_fingerprint","id":3,"type":{"family":"StringFamily","oid":25}},{"name":"statement_diagnostics_id","id":4,"type":{"family":"IntFamily","width":64,"oid":20},"nullable":true},{"name":"requested_at","id":5,"type":{"family":"TimestampTZFamily","oid":1184}},{"name":"min_execution_latency","id":6,"type":{"family":"IntervalFamily","oid":1186,"intervalDurationField":{}},"nullable":true},{"name":"expires_at","id":7,"type":{"family":"TimestampTZFamily","oid":1184},"nullable":true},{"name":"sampling_probability","id":8,"type":{"family":"FloatFamily","width":64,"oid":701},"nullable":true}],"nextColumnId":9,"families":[{"name":"primary","columnNames":["id","completed","statement_fingerprint","statement_diagnostics_id","requested_at","min_execution_latency","expires_at","sampling_probability"],"columnIds":[1,2,3,4,5,6,7,8]}],"nextFamilyId":1,"primaryIndex":{"name":"primary","id":1,"unique":true,"version":4,"keyColumnNames":["id"],"keyColumnDirections":["ASC"],"storeColumnNames":["completed","statement_fingerprint","statement_diagnostics_id","requested_at","min_execution_latency","expires_at","sampling_probability"],"keyColumnIds":[1],"storeColumnIds":[2,3,4,5,6,7,8],"foreignKey":{},"interleave":{},"partitioning":{},"encodingType":1,"sharded":{},"geoConfig":{},"constraintId":1},"indexes":[{"name":"completed_idx","id":2,"version":3,"keyColumnNames":["completed","id"],"keyColumnDirections":["ASC","ASC"],"storeColumnNames":["statement_fingerprint","min_execution_latency","expires_at","sampling_probability"],"keyColumnIds":[2,1],"storeColumnIds":[3,6,7,8],"foreignKey":{},"interleave":{},"partitioning":{},"sharded":{},"geoConfig":{}}],"nextIndexId":3,"privileges":{"users":[{"userProto":"admin","privileges":"480","withGrantOption":"480"},{"userProto":"root","privileges":"480","withGrantOption":"480"}],"ownerProto":"node","version":2},"nextMutationId":1,"formatVersion":3,"checks":[{"expr":"sampling_probability BETWEEN _:::FLOAT8 AND _:::FLOAT8","name":"check_sampling_probability","columnIds":[8],"constraintId":2}],"replacementOf":{"time":{}},"createAsOfTime":{"wallTime":"0"},"nextConstraintId":3}} -{"table":{"name":"transaction_statistics","id":43,"version":"1","modificationTime":{"wallTime":"0"},"parentId":1,"unexposedParentSchemaId":29,"columns":[{"name":"aggregated_ts","id":1,"type":{"family":"TimestampTZFamily","oid":1184}},{"name":"fingerprint_id","id":2,"type":{"family":"BytesFamily","oid":17}},{"name":"app_name","id":3,"type":{"family":"StringFamily","oid":25}},{"name":"node_id","id":4,"type":{"family":"IntFamily","width":64,"oid":20}},{"name":"agg_interval","id":5,"type":{"family":"IntervalFamily","oid":1186,"intervalDurationField":{}}},{"name":"metadata","id":6,"type":{"family":"JsonFamily","oid":3802}},{"name":"statistics","id":7,"type":{"family":"JsonFamily","oid":3802}},{"name":"crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_shard_8","id":8,"type":{"family":"IntFamily","width":32,"oid":23},"hidden":true,"computeExpr":"mod(fnv32(crdb_internal.datums_to_bytes(aggregated_ts, app_name, fingerprint_id, node_id)), _:::INT8)"}],"nextColumnId":9,"families":[{"name":"primary","columnNames":["crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_shard_8","aggregated_ts","fingerprint_id","app_name","node_id","agg_interval","metadata","statistics"],"columnIds":[8,1,2,3,4,5,6,7]}],"nextFamilyId":1,"primaryIndex":{"name":"primary","id":1,"unique":true,"version":4,"keyColumnNames":["crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_shard_8","aggregated_ts","fingerprint_id","app_name","node_id"],"keyColumnDirections":["ASC","ASC","ASC","ASC","ASC"],"storeColumnNames":["agg_interval","metadata","statistics"],"keyColumnIds":[8,1,2,3,4],"storeColumnIds":[5,6,7],"foreignKey":{},"interleave":{},"partitioning":{},"encodingType":1,"sharded":{"isSharded":true,"name":"crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_shard_8","shardBuckets":8,"columnNames":["aggregated_ts","app_name","fingerprint_id","node_id"]},"geoConfig":{},"constraintId":1},"indexes":[{"name":"fingerprint_stats_idx","id":2,"version":3,"keyColumnNames":["fingerprint_id"],"keyColumnDirections":["ASC"],"keyColumnIds":[2],"keySuffixColumnIds":[8,1,3,4],"foreignKey":{},"interleave":{},"partitioning":{},"sharded":{},"geoConfig":{}}],"nextIndexId":3,"privileges":{"users":[{"userProto":"admin","privileges":"32","withGrantOption":"32"},{"userProto":"root","privileges":"32","withGrantOption":"32"}],"ownerProto":"node","version":2},"nextMutationId":1,"formatVersion":3,"checks":[{"expr":"crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_shard_8 IN (_:::INT8, _:::INT8, _:::INT8, _:::INT8, _:::INT8, _:::INT8, _:::INT8, _:::INT8)","name":"check_crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_shard_8","columnIds":[8],"fromHashShardedColumn":true,"constraintId":2}],"replacementOf":{"time":{}},"createAsOfTime":{"wallTime":"0"},"nextConstraintId":3}} +{"table":{"name":"transaction_statistics","id":43,"version":"1","modificationTime":{"wallTime":"0"},"parentId":1,"unexposedParentSchemaId":29,"columns":[{"name":"aggregated_ts","id":1,"type":{"family":"TimestampTZFamily","oid":1184}},{"name":"fingerprint_id","id":2,"type":{"family":"BytesFamily","oid":17}},{"name":"app_name","id":3,"type":{"family":"StringFamily","oid":25}},{"name":"node_id","id":4,"type":{"family":"IntFamily","width":64,"oid":20}},{"name":"agg_interval","id":5,"type":{"family":"IntervalFamily","oid":1186,"intervalDurationField":{}}},{"name":"metadata","id":6,"type":{"family":"JsonFamily","oid":3802}},{"name":"statistics","id":7,"type":{"family":"JsonFamily","oid":3802}},{"name":"crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_shard_8","id":8,"type":{"family":"IntFamily","width":32,"oid":23},"hidden":true,"computeExpr":"mod(fnv32(crdb_internal.datums_to_bytes(aggregated_ts, app_name, fingerprint_id, node_id)), _:::INT8)"},{"name":"execution_count","id":9,"type":{"family":"IntFamily","width":64,"oid":20},"nullable":true,"computeExpr":"((statistics-\u003e'_':::STRING)-\u003e'_':::STRING)::INT8"},{"name":"service_latency","id":10,"type":{"family":"FloatFamily","width":64,"oid":701},"nullable":true,"computeExpr":"(((statistics-\u003e'_':::STRING)-\u003e'_':::STRING)-\u003e'_':::STRING)::FLOAT8"},{"name":"cpu_sql_nanos","id":11,"type":{"family":"FloatFamily","width":64,"oid":701},"nullable":true,"computeExpr":"(((statistics-\u003e'_':::STRING)-\u003e'_':::STRING)-\u003e'_':::STRING)::FLOAT8"},{"name":"contention_time","id":12,"type":{"family":"FloatFamily","width":64,"oid":701},"nullable":true,"computeExpr":"(((statistics-\u003e'_':::STRING)-\u003e'_':::STRING)-\u003e'_':::STRING)::FLOAT8"},{"name":"total_estimated_execution_time","id":13,"type":{"family":"FloatFamily","width":64,"oid":701},"nullable":true,"computeExpr":"((statistics-\u003e'_':::STRING)-\u003e'_':::STRING)::FLOAT8 * (((statistics-\u003e'_':::STRING)-\u003e'_':::STRING)-\u003e\u003e'_':::STRING)::FLOAT8"}],"nextColumnId":14,"families":[{"name":"primary","columnNames":["crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_shard_8","aggregated_ts","fingerprint_id","app_name","node_id","agg_interval","metadata","statistics","execution_count","service_latency","cpu_sql_nanos","contention_time","total_estimated_execution_time"],"columnIds":[8,1,2,3,4,5,6,7,9,10,11,12,13]}],"nextFamilyId":1,"primaryIndex":{"name":"primary","id":1,"unique":true,"version":4,"keyColumnNames":["crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_shard_8","aggregated_ts","fingerprint_id","app_name","node_id"],"keyColumnDirections":["ASC","ASC","ASC","ASC","ASC"],"storeColumnNames":["agg_interval","metadata","statistics","execution_count","service_latency","cpu_sql_nanos","contention_time","total_estimated_execution_time"],"keyColumnIds":[8,1,2,3,4],"storeColumnIds":[5,6,7,9,10,11,12,13],"foreignKey":{},"interleave":{},"partitioning":{},"encodingType":1,"sharded":{"isSharded":true,"name":"crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_shard_8","shardBuckets":8,"columnNames":["aggregated_ts","app_name","fingerprint_id","node_id"]},"geoConfig":{},"constraintId":1},"indexes":[{"name":"fingerprint_stats_idx","id":2,"version":3,"keyColumnNames":["fingerprint_id"],"keyColumnDirections":["ASC"],"keyColumnIds":[2],"keySuffixColumnIds":[8,1,3,4],"foreignKey":{},"interleave":{},"partitioning":{},"sharded":{},"geoConfig":{}},{"name":"execution_count_idx","id":3,"version":3,"keyColumnNames":["aggregated_ts","app_name","execution_count"],"keyColumnDirections":["ASC","ASC","DESC"],"keyColumnIds":[1,3,9],"keySuffixColumnIds":[8,2,4],"foreignKey":{},"interleave":{},"partitioning":{},"sharded":{},"geoConfig":{},"predicate":"app_name NOT LIKE '_':::STRING"},{"name":"service_latency_idx","id":4,"version":3,"keyColumnNames":["aggregated_ts","app_name","service_latency"],"keyColumnDirections":["ASC","ASC","DESC"],"keyColumnIds":[1,3,10],"keySuffixColumnIds":[8,2,4],"compositeColumnIds":[10],"foreignKey":{},"interleave":{},"partitioning":{},"sharded":{},"geoConfig":{},"predicate":"app_name NOT LIKE '_':::STRING"},{"name":"cpu_sql_nanos_idx","id":5,"version":3,"keyColumnNames":["aggregated_ts","app_name","cpu_sql_nanos"],"keyColumnDirections":["ASC","ASC","DESC"],"keyColumnIds":[1,3,11],"keySuffixColumnIds":[8,2,4],"compositeColumnIds":[11],"foreignKey":{},"interleave":{},"partitioning":{},"sharded":{},"geoConfig":{},"predicate":"app_name NOT LIKE '_':::STRING"},{"name":"contention_time_idx","id":6,"version":3,"keyColumnNames":["aggregated_ts","app_name","contention_time"],"keyColumnDirections":["ASC","ASC","DESC"],"keyColumnIds":[1,3,12],"keySuffixColumnIds":[8,2,4],"compositeColumnIds":[12],"foreignKey":{},"interleave":{},"partitioning":{},"sharded":{},"geoConfig":{},"predicate":"app_name NOT LIKE '_':::STRING"},{"name":"total_estimated_execution_time_idx","id":7,"version":3,"keyColumnNames":["aggregated_ts","app_name","total_estimated_execution_time"],"keyColumnDirections":["ASC","ASC","DESC"],"keyColumnIds":[1,3,13],"keySuffixColumnIds":[8,2,4],"compositeColumnIds":[13],"foreignKey":{},"interleave":{},"partitioning":{},"sharded":{},"geoConfig":{},"predicate":"app_name NOT LIKE '_':::STRING"}],"nextIndexId":8,"privileges":{"users":[{"userProto":"admin","privileges":"32","withGrantOption":"32"},{"userProto":"root","privileges":"32","withGrantOption":"32"}],"ownerProto":"node","version":2},"nextMutationId":1,"formatVersion":3,"checks":[{"expr":"crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_shard_8 IN (_:::INT8, _:::INT8, _:::INT8, _:::INT8, _:::INT8, _:::INT8, _:::INT8, _:::INT8)","name":"check_crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_shard_8","columnIds":[8],"fromHashShardedColumn":true,"constraintId":2}],"replacementOf":{"time":{}},"createAsOfTime":{"wallTime":"0"},"nextConstraintId":3}} schema_telemetry snapshot_id=7cd8a9ae-f35c-4cd2-970a-757174600874 max_records=10 ---- @@ -553,4 +573,4 @@ schema_telemetry snapshot_id=7cd8a9ae-f35c-4cd2-970a-757174600874 max_records=10 {"table":{"name":"sql_instances","id":46,"version":"1","modificationTime":{"wallTime":"0"},"parentId":1,"unexposedParentSchemaId":29,"columns":[{"name":"id","id":1,"type":{"family":"IntFamily","width":64,"oid":20}},{"name":"addr","id":2,"type":{"family":"StringFamily","oid":25},"nullable":true},{"name":"session_id","id":3,"type":{"family":"BytesFamily","oid":17},"nullable":true},{"name":"locality","id":4,"type":{"family":"JsonFamily","oid":3802},"nullable":true},{"name":"sql_addr","id":5,"type":{"family":"StringFamily","oid":25},"nullable":true},{"name":"crdb_region","id":6,"type":{"family":"BytesFamily","oid":17}},{"name":"binary_version","id":7,"type":{"family":"StringFamily","oid":25},"nullable":true}],"nextColumnId":8,"families":[{"name":"primary","columnNames":["id","addr","session_id","locality","sql_addr","crdb_region","binary_version"],"columnIds":[1,2,3,4,5,6,7]}],"nextFamilyId":1,"primaryIndex":{"name":"primary","id":2,"unique":true,"version":4,"keyColumnNames":["crdb_region","id"],"keyColumnDirections":["ASC","ASC"],"storeColumnNames":["addr","session_id","locality","sql_addr","binary_version"],"keyColumnIds":[6,1],"storeColumnIds":[2,3,4,5,7],"foreignKey":{},"interleave":{},"partitioning":{},"encodingType":1,"sharded":{},"geoConfig":{},"constraintId":1},"nextIndexId":3,"privileges":{"users":[{"userProto":"admin","privileges":"480","withGrantOption":"480"},{"userProto":"root","privileges":"480","withGrantOption":"480"}],"ownerProto":"node","version":2},"nextMutationId":1,"formatVersion":3,"replacementOf":{"time":{}},"createAsOfTime":{"wallTime":"0"},"nextConstraintId":2}} {"table":{"name":"statement_diagnostics","id":36,"version":"1","modificationTime":{"wallTime":"0"},"parentId":1,"unexposedParentSchemaId":29,"columns":[{"name":"id","id":1,"type":{"family":"IntFamily","width":64,"oid":20},"defaultExpr":"unique_rowid()"},{"name":"statement_fingerprint","id":2,"type":{"family":"StringFamily","oid":25}},{"name":"statement","id":3,"type":{"family":"StringFamily","oid":25}},{"name":"collected_at","id":4,"type":{"family":"TimestampTZFamily","oid":1184}},{"name":"trace","id":5,"type":{"family":"JsonFamily","oid":3802},"nullable":true},{"name":"bundle_chunks","id":6,"type":{"family":"ArrayFamily","width":64,"arrayElemType":"IntFamily","oid":1016,"arrayContents":{"family":"IntFamily","width":64,"oid":20}},"nullable":true},{"name":"error","id":7,"type":{"family":"StringFamily","oid":25},"nullable":true}],"nextColumnId":8,"families":[{"name":"primary","columnNames":["id","statement_fingerprint","statement","collected_at","trace","bundle_chunks","error"],"columnIds":[1,2,3,4,5,6,7]}],"nextFamilyId":1,"primaryIndex":{"name":"primary","id":1,"unique":true,"version":4,"keyColumnNames":["id"],"keyColumnDirections":["ASC"],"storeColumnNames":["statement_fingerprint","statement","collected_at","trace","bundle_chunks","error"],"keyColumnIds":[1],"storeColumnIds":[2,3,4,5,6,7],"foreignKey":{},"interleave":{},"partitioning":{},"encodingType":1,"sharded":{},"geoConfig":{},"constraintId":1},"nextIndexId":2,"privileges":{"users":[{"userProto":"admin","privileges":"480","withGrantOption":"480"},{"userProto":"root","privileges":"480","withGrantOption":"480"}],"ownerProto":"node","version":2},"nextMutationId":1,"formatVersion":3,"replacementOf":{"time":{}},"createAsOfTime":{"wallTime":"0"},"nextConstraintId":2}} {"table":{"name":"statement_diagnostics_requests","id":35,"version":"1","modificationTime":{"wallTime":"0"},"parentId":1,"unexposedParentSchemaId":29,"columns":[{"name":"id","id":1,"type":{"family":"IntFamily","width":64,"oid":20},"defaultExpr":"unique_rowid()"},{"name":"completed","id":2,"type":{"oid":16},"defaultExpr":"false"},{"name":"statement_fingerprint","id":3,"type":{"family":"StringFamily","oid":25}},{"name":"statement_diagnostics_id","id":4,"type":{"family":"IntFamily","width":64,"oid":20},"nullable":true},{"name":"requested_at","id":5,"type":{"family":"TimestampTZFamily","oid":1184}},{"name":"min_execution_latency","id":6,"type":{"family":"IntervalFamily","oid":1186,"intervalDurationField":{}},"nullable":true},{"name":"expires_at","id":7,"type":{"family":"TimestampTZFamily","oid":1184},"nullable":true},{"name":"sampling_probability","id":8,"type":{"family":"FloatFamily","width":64,"oid":701},"nullable":true}],"nextColumnId":9,"families":[{"name":"primary","columnNames":["id","completed","statement_fingerprint","statement_diagnostics_id","requested_at","min_execution_latency","expires_at","sampling_probability"],"columnIds":[1,2,3,4,5,6,7,8]}],"nextFamilyId":1,"primaryIndex":{"name":"primary","id":1,"unique":true,"version":4,"keyColumnNames":["id"],"keyColumnDirections":["ASC"],"storeColumnNames":["completed","statement_fingerprint","statement_diagnostics_id","requested_at","min_execution_latency","expires_at","sampling_probability"],"keyColumnIds":[1],"storeColumnIds":[2,3,4,5,6,7,8],"foreignKey":{},"interleave":{},"partitioning":{},"encodingType":1,"sharded":{},"geoConfig":{},"constraintId":1},"indexes":[{"name":"completed_idx","id":2,"version":3,"keyColumnNames":["completed","id"],"keyColumnDirections":["ASC","ASC"],"storeColumnNames":["statement_fingerprint","min_execution_latency","expires_at","sampling_probability"],"keyColumnIds":[2,1],"storeColumnIds":[3,6,7,8],"foreignKey":{},"interleave":{},"partitioning":{},"sharded":{},"geoConfig":{}}],"nextIndexId":3,"privileges":{"users":[{"userProto":"admin","privileges":"480","withGrantOption":"480"},{"userProto":"root","privileges":"480","withGrantOption":"480"}],"ownerProto":"node","version":2},"nextMutationId":1,"formatVersion":3,"checks":[{"expr":"sampling_probability BETWEEN _:::FLOAT8 AND _:::FLOAT8","name":"check_sampling_probability","columnIds":[8],"constraintId":2}],"replacementOf":{"time":{}},"createAsOfTime":{"wallTime":"0"},"nextConstraintId":3}} -{"table":{"name":"transaction_statistics","id":43,"version":"1","modificationTime":{"wallTime":"0"},"parentId":1,"unexposedParentSchemaId":29,"columns":[{"name":"aggregated_ts","id":1,"type":{"family":"TimestampTZFamily","oid":1184}},{"name":"fingerprint_id","id":2,"type":{"family":"BytesFamily","oid":17}},{"name":"app_name","id":3,"type":{"family":"StringFamily","oid":25}},{"name":"node_id","id":4,"type":{"family":"IntFamily","width":64,"oid":20}},{"name":"agg_interval","id":5,"type":{"family":"IntervalFamily","oid":1186,"intervalDurationField":{}}},{"name":"metadata","id":6,"type":{"family":"JsonFamily","oid":3802}},{"name":"statistics","id":7,"type":{"family":"JsonFamily","oid":3802}},{"name":"crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_shard_8","id":8,"type":{"family":"IntFamily","width":32,"oid":23},"hidden":true,"computeExpr":"mod(fnv32(crdb_internal.datums_to_bytes(aggregated_ts, app_name, fingerprint_id, node_id)), _:::INT8)"}],"nextColumnId":9,"families":[{"name":"primary","columnNames":["crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_shard_8","aggregated_ts","fingerprint_id","app_name","node_id","agg_interval","metadata","statistics"],"columnIds":[8,1,2,3,4,5,6,7]}],"nextFamilyId":1,"primaryIndex":{"name":"primary","id":1,"unique":true,"version":4,"keyColumnNames":["crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_shard_8","aggregated_ts","fingerprint_id","app_name","node_id"],"keyColumnDirections":["ASC","ASC","ASC","ASC","ASC"],"storeColumnNames":["agg_interval","metadata","statistics"],"keyColumnIds":[8,1,2,3,4],"storeColumnIds":[5,6,7],"foreignKey":{},"interleave":{},"partitioning":{},"encodingType":1,"sharded":{"isSharded":true,"name":"crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_shard_8","shardBuckets":8,"columnNames":["aggregated_ts","app_name","fingerprint_id","node_id"]},"geoConfig":{},"constraintId":1},"indexes":[{"name":"fingerprint_stats_idx","id":2,"version":3,"keyColumnNames":["fingerprint_id"],"keyColumnDirections":["ASC"],"keyColumnIds":[2],"keySuffixColumnIds":[8,1,3,4],"foreignKey":{},"interleave":{},"partitioning":{},"sharded":{},"geoConfig":{}}],"nextIndexId":3,"privileges":{"users":[{"userProto":"admin","privileges":"32","withGrantOption":"32"},{"userProto":"root","privileges":"32","withGrantOption":"32"}],"ownerProto":"node","version":2},"nextMutationId":1,"formatVersion":3,"checks":[{"expr":"crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_shard_8 IN (_:::INT8, _:::INT8, _:::INT8, _:::INT8, _:::INT8, _:::INT8, _:::INT8, _:::INT8)","name":"check_crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_shard_8","columnIds":[8],"fromHashShardedColumn":true,"constraintId":2}],"replacementOf":{"time":{}},"createAsOfTime":{"wallTime":"0"},"nextConstraintId":3}} +{"table":{"name":"transaction_statistics","id":43,"version":"1","modificationTime":{"wallTime":"0"},"parentId":1,"unexposedParentSchemaId":29,"columns":[{"name":"aggregated_ts","id":1,"type":{"family":"TimestampTZFamily","oid":1184}},{"name":"fingerprint_id","id":2,"type":{"family":"BytesFamily","oid":17}},{"name":"app_name","id":3,"type":{"family":"StringFamily","oid":25}},{"name":"node_id","id":4,"type":{"family":"IntFamily","width":64,"oid":20}},{"name":"agg_interval","id":5,"type":{"family":"IntervalFamily","oid":1186,"intervalDurationField":{}}},{"name":"metadata","id":6,"type":{"family":"JsonFamily","oid":3802}},{"name":"statistics","id":7,"type":{"family":"JsonFamily","oid":3802}},{"name":"crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_shard_8","id":8,"type":{"family":"IntFamily","width":32,"oid":23},"hidden":true,"computeExpr":"mod(fnv32(crdb_internal.datums_to_bytes(aggregated_ts, app_name, fingerprint_id, node_id)), _:::INT8)"},{"name":"execution_count","id":9,"type":{"family":"IntFamily","width":64,"oid":20},"nullable":true,"computeExpr":"((statistics-\u003e'_':::STRING)-\u003e'_':::STRING)::INT8"},{"name":"service_latency","id":10,"type":{"family":"FloatFamily","width":64,"oid":701},"nullable":true,"computeExpr":"(((statistics-\u003e'_':::STRING)-\u003e'_':::STRING)-\u003e'_':::STRING)::FLOAT8"},{"name":"cpu_sql_nanos","id":11,"type":{"family":"FloatFamily","width":64,"oid":701},"nullable":true,"computeExpr":"(((statistics-\u003e'_':::STRING)-\u003e'_':::STRING)-\u003e'_':::STRING)::FLOAT8"},{"name":"contention_time","id":12,"type":{"family":"FloatFamily","width":64,"oid":701},"nullable":true,"computeExpr":"(((statistics-\u003e'_':::STRING)-\u003e'_':::STRING)-\u003e'_':::STRING)::FLOAT8"},{"name":"total_estimated_execution_time","id":13,"type":{"family":"FloatFamily","width":64,"oid":701},"nullable":true,"computeExpr":"((statistics-\u003e'_':::STRING)-\u003e'_':::STRING)::FLOAT8 * (((statistics-\u003e'_':::STRING)-\u003e'_':::STRING)-\u003e\u003e'_':::STRING)::FLOAT8"}],"nextColumnId":14,"families":[{"name":"primary","columnNames":["crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_shard_8","aggregated_ts","fingerprint_id","app_name","node_id","agg_interval","metadata","statistics","execution_count","service_latency","cpu_sql_nanos","contention_time","total_estimated_execution_time"],"columnIds":[8,1,2,3,4,5,6,7,9,10,11,12,13]}],"nextFamilyId":1,"primaryIndex":{"name":"primary","id":1,"unique":true,"version":4,"keyColumnNames":["crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_shard_8","aggregated_ts","fingerprint_id","app_name","node_id"],"keyColumnDirections":["ASC","ASC","ASC","ASC","ASC"],"storeColumnNames":["agg_interval","metadata","statistics","execution_count","service_latency","cpu_sql_nanos","contention_time","total_estimated_execution_time"],"keyColumnIds":[8,1,2,3,4],"storeColumnIds":[5,6,7,9,10,11,12,13],"foreignKey":{},"interleave":{},"partitioning":{},"encodingType":1,"sharded":{"isSharded":true,"name":"crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_shard_8","shardBuckets":8,"columnNames":["aggregated_ts","app_name","fingerprint_id","node_id"]},"geoConfig":{},"constraintId":1},"indexes":[{"name":"fingerprint_stats_idx","id":2,"version":3,"keyColumnNames":["fingerprint_id"],"keyColumnDirections":["ASC"],"keyColumnIds":[2],"keySuffixColumnIds":[8,1,3,4],"foreignKey":{},"interleave":{},"partitioning":{},"sharded":{},"geoConfig":{}},{"name":"execution_count_idx","id":3,"version":3,"keyColumnNames":["aggregated_ts","app_name","execution_count"],"keyColumnDirections":["ASC","ASC","DESC"],"keyColumnIds":[1,3,9],"keySuffixColumnIds":[8,2,4],"foreignKey":{},"interleave":{},"partitioning":{},"sharded":{},"geoConfig":{},"predicate":"app_name NOT LIKE '_':::STRING"},{"name":"service_latency_idx","id":4,"version":3,"keyColumnNames":["aggregated_ts","app_name","service_latency"],"keyColumnDirections":["ASC","ASC","DESC"],"keyColumnIds":[1,3,10],"keySuffixColumnIds":[8,2,4],"compositeColumnIds":[10],"foreignKey":{},"interleave":{},"partitioning":{},"sharded":{},"geoConfig":{},"predicate":"app_name NOT LIKE '_':::STRING"},{"name":"cpu_sql_nanos_idx","id":5,"version":3,"keyColumnNames":["aggregated_ts","app_name","cpu_sql_nanos"],"keyColumnDirections":["ASC","ASC","DESC"],"keyColumnIds":[1,3,11],"keySuffixColumnIds":[8,2,4],"compositeColumnIds":[11],"foreignKey":{},"interleave":{},"partitioning":{},"sharded":{},"geoConfig":{},"predicate":"app_name NOT LIKE '_':::STRING"},{"name":"contention_time_idx","id":6,"version":3,"keyColumnNames":["aggregated_ts","app_name","contention_time"],"keyColumnDirections":["ASC","ASC","DESC"],"keyColumnIds":[1,3,12],"keySuffixColumnIds":[8,2,4],"compositeColumnIds":[12],"foreignKey":{},"interleave":{},"partitioning":{},"sharded":{},"geoConfig":{},"predicate":"app_name NOT LIKE '_':::STRING"},{"name":"total_estimated_execution_time_idx","id":7,"version":3,"keyColumnNames":["aggregated_ts","app_name","total_estimated_execution_time"],"keyColumnDirections":["ASC","ASC","DESC"],"keyColumnIds":[1,3,13],"keySuffixColumnIds":[8,2,4],"compositeColumnIds":[13],"foreignKey":{},"interleave":{},"partitioning":{},"sharded":{},"geoConfig":{},"predicate":"app_name NOT LIKE '_':::STRING"}],"nextIndexId":8,"privileges":{"users":[{"userProto":"admin","privileges":"32","withGrantOption":"32"},{"userProto":"root","privileges":"32","withGrantOption":"32"}],"ownerProto":"node","version":2},"nextMutationId":1,"formatVersion":3,"checks":[{"expr":"crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_shard_8 IN (_:::INT8, _:::INT8, _:::INT8, _:::INT8, _:::INT8, _:::INT8, _:::INT8, _:::INT8)","name":"check_crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_shard_8","columnIds":[8],"fromHashShardedColumn":true,"constraintId":2}],"replacementOf":{"time":{}},"createAsOfTime":{"wallTime":"0"},"nextConstraintId":3}} diff --git a/pkg/sql/logictest/testdata/logic_test/crdb_internal_catalog b/pkg/sql/logictest/testdata/logic_test/crdb_internal_catalog index 6041ae560032..dddb2d161a37 100644 --- a/pkg/sql/logictest/testdata/logic_test/crdb_internal_catalog +++ b/pkg/sql/logictest/testdata/logic_test/crdb_internal_catalog @@ -136,8 +136,8 @@ SELECT id, strip_volatile(descriptor) FROM crdb_internal.kv_catalog_descriptor 39 {"table": {"columns": [{"id": 1, "name": "session_id", "type": {"family": "BytesFamily", "oid": 17}}, {"id": 2, "name": "expiration", "type": {"family": "DecimalFamily", "oid": 1700}}, {"id": 3, "name": "crdb_region", "type": {"family": "BytesFamily", "oid": 17}}], "formatVersion": 3, "id": 39, "name": "sqlliveness", "nextColumnId": 4, "nextConstraintId": 2, "nextIndexId": 3, "nextMutationId": 1, "parentId": 1, "primaryIndex": {"constraintId": 1, "encodingType": 1, "foreignKey": {}, "geoConfig": {}, "id": 2, "interleave": {}, "keyColumnDirections": ["ASC", "ASC"], "keyColumnIds": [3, 1], "keyColumnNames": ["crdb_region", "session_id"], "name": "primary", "partitioning": {}, "sharded": {}, "storeColumnIds": [2], "storeColumnNames": ["expiration"], "unique": true, "version": 4}, "privileges": {"ownerProto": "node", "users": [{"privileges": "480", "userProto": "admin", "withGrantOption": "480"}, {"privileges": "480", "userProto": "root", "withGrantOption": "480"}], "version": 2}, "replacementOf": {"time": {}}, "unexposedParentSchemaId": 29, "version": "1"}} 40 {"table": {"columns": [{"id": 1, "name": "major", "type": {"family": "IntFamily", "oid": 20, "width": 64}}, {"id": 2, "name": "minor", "type": {"family": "IntFamily", "oid": 20, "width": 64}}, {"id": 3, "name": "patch", "type": {"family": "IntFamily", "oid": 20, "width": 64}}, {"id": 4, "name": "internal", "type": {"family": "IntFamily", "oid": 20, "width": 64}}, {"id": 5, "name": "completed_at", "type": {"family": "TimestampTZFamily", "oid": 1184}}], "formatVersion": 3, "id": 40, "name": "migrations", "nextColumnId": 6, "nextConstraintId": 2, "nextIndexId": 2, "nextMutationId": 1, "parentId": 1, "primaryIndex": {"constraintId": 1, "encodingType": 1, "foreignKey": {}, "geoConfig": {}, "id": 1, "interleave": {}, "keyColumnDirections": ["ASC", "ASC", "ASC", "ASC"], "keyColumnIds": [1, 2, 3, 4], "keyColumnNames": ["major", "minor", "patch", "internal"], "name": "primary", "partitioning": {}, "sharded": {}, "storeColumnIds": [5], "storeColumnNames": ["completed_at"], "unique": true, "version": 4}, "privileges": {"ownerProto": "node", "users": [{"privileges": "480", "userProto": "admin", "withGrantOption": "480"}, {"privileges": "480", "userProto": "root", "withGrantOption": "480"}], "version": 2}, "replacementOf": {"time": {}}, "unexposedParentSchemaId": 29, "version": "1"}} 41 {"table": {"columns": [{"id": 1, "name": "id", "type": {"family": "UuidFamily", "oid": 2950}}, {"id": 2, "name": "secret", "type": {"family": "BytesFamily", "oid": 17}}, {"id": 3, "name": "expiration", "type": {"family": "TimestampTZFamily", "oid": 1184}}], "formatVersion": 3, "id": 41, "name": "join_tokens", "nextColumnId": 4, "nextConstraintId": 2, "nextIndexId": 2, "nextMutationId": 1, "parentId": 1, "primaryIndex": {"constraintId": 1, "encodingType": 1, "foreignKey": {}, "geoConfig": {}, "id": 1, "interleave": {}, "keyColumnDirections": ["ASC"], "keyColumnIds": [1], "keyColumnNames": ["id"], "name": "primary", "partitioning": {}, "sharded": {}, "storeColumnIds": [2, 3], "storeColumnNames": ["secret", "expiration"], "unique": true, "version": 4}, "privileges": {"ownerProto": "node", "users": [{"privileges": "480", "userProto": "admin", "withGrantOption": "480"}, {"privileges": "480", "userProto": "root", "withGrantOption": "480"}], "version": 2}, "replacementOf": {"time": {}}, "unexposedParentSchemaId": 29, "version": "1"}} -42 {"table": {"checks": [{"columnIds": [11], "constraintId": 2, "expr": "crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_plan_hash_transaction_fingerprint_id_shard_8 IN (0:::INT8, 1:::INT8, 2:::INT8, 3:::INT8, 4:::INT8, 5:::INT8, 6:::INT8, 7:::INT8)", "fromHashShardedColumn": true, "name": "check_crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_plan_hash_transaction_fingerprint_id_shard_8"}], "columns": [{"id": 1, "name": "aggregated_ts", "type": {"family": "TimestampTZFamily", "oid": 1184}}, {"id": 2, "name": "fingerprint_id", "type": {"family": "BytesFamily", "oid": 17}}, {"id": 3, "name": "transaction_fingerprint_id", "type": {"family": "BytesFamily", "oid": 17}}, {"id": 4, "name": "plan_hash", "type": {"family": "BytesFamily", "oid": 17}}, {"id": 5, "name": "app_name", "type": {"family": "StringFamily", "oid": 25}}, {"id": 6, "name": "node_id", "type": {"family": "IntFamily", "oid": 20, "width": 64}}, {"id": 7, "name": "agg_interval", "type": {"family": "IntervalFamily", "intervalDurationField": {}, "oid": 1186}}, {"id": 8, "name": "metadata", "type": {"family": "JsonFamily", "oid": 3802}}, {"id": 9, "name": "statistics", "type": {"family": "JsonFamily", "oid": 3802}}, {"id": 10, "name": "plan", "type": {"family": "JsonFamily", "oid": 3802}}, {"computeExpr": "mod(fnv32(crdb_internal.datums_to_bytes(aggregated_ts, app_name, fingerprint_id, node_id, plan_hash, transaction_fingerprint_id)), 8:::INT8)", "hidden": true, "id": 11, "name": "crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_plan_hash_transaction_fingerprint_id_shard_8", "type": {"family": "IntFamily", "oid": 23, "width": 32}}, {"defaultExpr": "ARRAY[]:::STRING[]", "id": 12, "name": "index_recommendations", "type": {"arrayContents": {"family": "StringFamily", "oid": 25}, "arrayElemType": "StringFamily", "family": "ArrayFamily", "oid": 1009}}, {"computeExpr": "(statistics->'statistics':::STRING)->'indexes':::STRING", "id": 13, "name": "indexes_usage", "nullable": true, "type": {"family": "JsonFamily", "oid": 3802}, "virtual": true}], "formatVersion": 3, "id": 42, "indexes": [{"foreignKey": {}, "geoConfig": {}, "id": 2, "interleave": {}, "keyColumnDirections": ["ASC", "ASC"], "keyColumnIds": [2, 3], "keyColumnNames": ["fingerprint_id", "transaction_fingerprint_id"], "keySuffixColumnIds": [11, 1, 4, 5, 6], "name": "fingerprint_stats_idx", "partitioning": {}, "sharded": {}, "version": 3}, {"foreignKey": {}, "geoConfig": {}, "id": 3, "interleave": {}, "invertedColumnKinds": ["DEFAULT"], "keyColumnDirections": ["ASC"], "keyColumnIds": [13], "keyColumnNames": ["indexes_usage"], "keySuffixColumnIds": [11, 1, 2, 3, 4, 5, 6], "name": "indexes_usage_idx", "partitioning": {}, "sharded": {}, "type": "INVERTED", "version": 3}], "name": "statement_statistics", "nextColumnId": 14, "nextConstraintId": 3, "nextIndexId": 4, "nextMutationId": 1, "parentId": 1, "primaryIndex": {"constraintId": 1, "encodingType": 1, "foreignKey": {}, "geoConfig": {}, "id": 1, "interleave": {}, "keyColumnDirections": ["ASC", "ASC", "ASC", "ASC", "ASC", "ASC", "ASC"], "keyColumnIds": [11, 1, 2, 3, 4, 5, 6], "keyColumnNames": ["crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_plan_hash_transaction_fingerprint_id_shard_8", "aggregated_ts", "fingerprint_id", "transaction_fingerprint_id", "plan_hash", "app_name", "node_id"], "name": "primary", "partitioning": {}, "sharded": {"columnNames": ["aggregated_ts", "app_name", "fingerprint_id", "node_id", "plan_hash", "transaction_fingerprint_id"], "isSharded": true, "name": "crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_plan_hash_transaction_fingerprint_id_shard_8", "shardBuckets": 8}, "storeColumnIds": [7, 8, 9, 10, 12], "storeColumnNames": ["agg_interval", "metadata", "statistics", "plan", "index_recommendations"], "unique": true, "version": 4}, "privileges": {"ownerProto": "node", "users": [{"privileges": "32", "userProto": "admin", "withGrantOption": "32"}, {"privileges": "32", "userProto": "root", "withGrantOption": "32"}], "version": 2}, "replacementOf": {"time": {}}, "unexposedParentSchemaId": 29, "version": "1"}} -43 {"table": {"checks": [{"columnIds": [8], "constraintId": 2, "expr": "crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_shard_8 IN (0:::INT8, 1:::INT8, 2:::INT8, 3:::INT8, 4:::INT8, 5:::INT8, 6:::INT8, 7:::INT8)", "fromHashShardedColumn": true, "name": "check_crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_shard_8"}], "columns": [{"id": 1, "name": "aggregated_ts", "type": {"family": "TimestampTZFamily", "oid": 1184}}, {"id": 2, "name": "fingerprint_id", "type": {"family": "BytesFamily", "oid": 17}}, {"id": 3, "name": "app_name", "type": {"family": "StringFamily", "oid": 25}}, {"id": 4, "name": "node_id", "type": {"family": "IntFamily", "oid": 20, "width": 64}}, {"id": 5, "name": "agg_interval", "type": {"family": "IntervalFamily", "intervalDurationField": {}, "oid": 1186}}, {"id": 6, "name": "metadata", "type": {"family": "JsonFamily", "oid": 3802}}, {"id": 7, "name": "statistics", "type": {"family": "JsonFamily", "oid": 3802}}, {"computeExpr": "mod(fnv32(crdb_internal.datums_to_bytes(aggregated_ts, app_name, fingerprint_id, node_id)), 8:::INT8)", "hidden": true, "id": 8, "name": "crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_shard_8", "type": {"family": "IntFamily", "oid": 23, "width": 32}}], "formatVersion": 3, "id": 43, "indexes": [{"foreignKey": {}, "geoConfig": {}, "id": 2, "interleave": {}, "keyColumnDirections": ["ASC"], "keyColumnIds": [2], "keyColumnNames": ["fingerprint_id"], "keySuffixColumnIds": [8, 1, 3, 4], "name": "fingerprint_stats_idx", "partitioning": {}, "sharded": {}, "version": 3}], "name": "transaction_statistics", "nextColumnId": 9, "nextConstraintId": 3, "nextIndexId": 3, "nextMutationId": 1, "parentId": 1, "primaryIndex": {"constraintId": 1, "encodingType": 1, "foreignKey": {}, "geoConfig": {}, "id": 1, "interleave": {}, "keyColumnDirections": ["ASC", "ASC", "ASC", "ASC", "ASC"], "keyColumnIds": [8, 1, 2, 3, 4], "keyColumnNames": ["crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_shard_8", "aggregated_ts", "fingerprint_id", "app_name", "node_id"], "name": "primary", "partitioning": {}, "sharded": {"columnNames": ["aggregated_ts", "app_name", "fingerprint_id", "node_id"], "isSharded": true, "name": "crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_shard_8", "shardBuckets": 8}, "storeColumnIds": [5, 6, 7], "storeColumnNames": ["agg_interval", "metadata", "statistics"], "unique": true, "version": 4}, "privileges": {"ownerProto": "node", "users": [{"privileges": "32", "userProto": "admin", "withGrantOption": "32"}, {"privileges": "32", "userProto": "root", "withGrantOption": "32"}], "version": 2}, "replacementOf": {"time": {}}, "unexposedParentSchemaId": 29, "version": "1"}} +42 {"table": {"checks": [{"columnIds": [11], "constraintId": 2, "expr": "crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_plan_hash_transaction_fingerprint_id_shard_8 IN (0:::INT8, 1:::INT8, 2:::INT8, 3:::INT8, 4:::INT8, 5:::INT8, 6:::INT8, 7:::INT8)", "fromHashShardedColumn": true, "name": "check_crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_plan_hash_transaction_fingerprint_id_shard_8"}], "columns": [{"id": 1, "name": "aggregated_ts", "type": {"family": "TimestampTZFamily", "oid": 1184}}, {"id": 2, "name": "fingerprint_id", "type": {"family": "BytesFamily", "oid": 17}}, {"id": 3, "name": "transaction_fingerprint_id", "type": {"family": "BytesFamily", "oid": 17}}, {"id": 4, "name": "plan_hash", "type": {"family": "BytesFamily", "oid": 17}}, {"id": 5, "name": "app_name", "type": {"family": "StringFamily", "oid": 25}}, {"id": 6, "name": "node_id", "type": {"family": "IntFamily", "oid": 20, "width": 64}}, {"id": 7, "name": "agg_interval", "type": {"family": "IntervalFamily", "intervalDurationField": {}, "oid": 1186}}, {"id": 8, "name": "metadata", "type": {"family": "JsonFamily", "oid": 3802}}, {"id": 9, "name": "statistics", "type": {"family": "JsonFamily", "oid": 3802}}, {"id": 10, "name": "plan", "type": {"family": "JsonFamily", "oid": 3802}}, {"computeExpr": "mod(fnv32(crdb_internal.datums_to_bytes(aggregated_ts, app_name, fingerprint_id, node_id, plan_hash, transaction_fingerprint_id)), 8:::INT8)", "hidden": true, "id": 11, "name": "crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_plan_hash_transaction_fingerprint_id_shard_8", "type": {"family": "IntFamily", "oid": 23, "width": 32}}, {"defaultExpr": "ARRAY[]:::STRING[]", "id": 12, "name": "index_recommendations", "type": {"arrayContents": {"family": "StringFamily", "oid": 25}, "arrayElemType": "StringFamily", "family": "ArrayFamily", "oid": 1009}}, {"computeExpr": "(statistics->'statistics':::STRING)->'indexes':::STRING", "id": 13, "name": "indexes_usage", "nullable": true, "type": {"family": "JsonFamily", "oid": 3802}, "virtual": true}, {"computeExpr": "((statistics->'statistics':::STRING)->'cnt':::STRING)::INT8", "id": 14, "name": "execution_count", "nullable": true, "type": {"family": "IntFamily", "oid": 20, "width": 64}}, {"computeExpr": "(((statistics->'statistics':::STRING)->'svcLat':::STRING)->'mean':::STRING)::FLOAT8", "id": 15, "name": "service_latency", "nullable": true, "type": {"family": "FloatFamily", "oid": 701, "width": 64}}, {"computeExpr": "(((statistics->'execution_statistics':::STRING)->'cpuSQLNanos':::STRING)->'mean':::STRING)::FLOAT8", "id": 16, "name": "cpu_sql_nanos", "nullable": true, "type": {"family": "FloatFamily", "oid": 701, "width": 64}}, {"computeExpr": "(((statistics->'execution_statistics':::STRING)->'contentionTime':::STRING)->'mean':::STRING)::FLOAT8", "id": 17, "name": "contention_time", "nullable": true, "type": {"family": "FloatFamily", "oid": 701, "width": 64}}, {"computeExpr": "((statistics->'statistics':::STRING)->'cnt':::STRING)::FLOAT8 * (((statistics->'statistics':::STRING)->'svcLat':::STRING)->>'mean':::STRING)::FLOAT8", "id": 18, "name": "total_estimated_execution_time", "nullable": true, "type": {"family": "FloatFamily", "oid": 701, "width": 64}}], "formatVersion": 3, "id": 42, "indexes": [{"foreignKey": {}, "geoConfig": {}, "id": 2, "interleave": {}, "keyColumnDirections": ["ASC", "ASC"], "keyColumnIds": [2, 3], "keyColumnNames": ["fingerprint_id", "transaction_fingerprint_id"], "keySuffixColumnIds": [11, 1, 4, 5, 6], "name": "fingerprint_stats_idx", "partitioning": {}, "sharded": {}, "version": 3}, {"foreignKey": {}, "geoConfig": {}, "id": 3, "interleave": {}, "invertedColumnKinds": ["DEFAULT"], "keyColumnDirections": ["ASC"], "keyColumnIds": [13], "keyColumnNames": ["indexes_usage"], "keySuffixColumnIds": [11, 1, 2, 3, 4, 5, 6], "name": "indexes_usage_idx", "partitioning": {}, "sharded": {}, "type": "INVERTED", "version": 3}, {"foreignKey": {}, "geoConfig": {}, "id": 4, "interleave": {}, "keyColumnDirections": ["ASC", "ASC", "DESC"], "keyColumnIds": [1, 5, 14], "keyColumnNames": ["aggregated_ts", "app_name", "execution_count"], "keySuffixColumnIds": [11, 2, 3, 4, 6], "name": "execution_count_idx", "partitioning": {}, "predicate": "app_name NOT LIKE '$ internal%':::STRING", "sharded": {}, "version": 3}, {"compositeColumnIds": [15], "foreignKey": {}, "geoConfig": {}, "id": 5, "interleave": {}, "keyColumnDirections": ["ASC", "ASC", "DESC"], "keyColumnIds": [1, 5, 15], "keyColumnNames": ["aggregated_ts", "app_name", "service_latency"], "keySuffixColumnIds": [11, 2, 3, 4, 6], "name": "service_latency_idx", "partitioning": {}, "predicate": "app_name NOT LIKE '$ internal%':::STRING", "sharded": {}, "version": 3}, {"compositeColumnIds": [16], "foreignKey": {}, "geoConfig": {}, "id": 6, "interleave": {}, "keyColumnDirections": ["ASC", "ASC", "DESC"], "keyColumnIds": [1, 5, 16], "keyColumnNames": ["aggregated_ts", "app_name", "cpu_sql_nanos"], "keySuffixColumnIds": [11, 2, 3, 4, 6], "name": "cpu_sql_nanos_idx", "partitioning": {}, "predicate": "app_name NOT LIKE '$ internal%':::STRING", "sharded": {}, "version": 3}, {"compositeColumnIds": [17], "foreignKey": {}, "geoConfig": {}, "id": 7, "interleave": {}, "keyColumnDirections": ["ASC", "ASC", "DESC"], "keyColumnIds": [1, 5, 17], "keyColumnNames": ["aggregated_ts", "app_name", "contention_time"], "keySuffixColumnIds": [11, 2, 3, 4, 6], "name": "contention_time_idx", "partitioning": {}, "predicate": "app_name NOT LIKE '$ internal%':::STRING", "sharded": {}, "version": 3}, {"compositeColumnIds": [18], "foreignKey": {}, "geoConfig": {}, "id": 8, "interleave": {}, "keyColumnDirections": ["ASC", "ASC", "DESC"], "keyColumnIds": [1, 5, 18], "keyColumnNames": ["aggregated_ts", "app_name", "total_estimated_execution_time"], "keySuffixColumnIds": [11, 2, 3, 4, 6], "name": "total_estimated_execution_time_idx", "partitioning": {}, "predicate": "app_name NOT LIKE '$ internal%':::STRING", "sharded": {}, "version": 3}], "name": "statement_statistics", "nextColumnId": 19, "nextConstraintId": 3, "nextIndexId": 9, "nextMutationId": 1, "parentId": 1, "primaryIndex": {"constraintId": 1, "encodingType": 1, "foreignKey": {}, "geoConfig": {}, "id": 1, "interleave": {}, "keyColumnDirections": ["ASC", "ASC", "ASC", "ASC", "ASC", "ASC", "ASC"], "keyColumnIds": [11, 1, 2, 3, 4, 5, 6], "keyColumnNames": ["crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_plan_hash_transaction_fingerprint_id_shard_8", "aggregated_ts", "fingerprint_id", "transaction_fingerprint_id", "plan_hash", "app_name", "node_id"], "name": "primary", "partitioning": {}, "sharded": {"columnNames": ["aggregated_ts", "app_name", "fingerprint_id", "node_id", "plan_hash", "transaction_fingerprint_id"], "isSharded": true, "name": "crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_plan_hash_transaction_fingerprint_id_shard_8", "shardBuckets": 8}, "storeColumnIds": [7, 8, 9, 10, 12, 14, 15, 16, 17, 18], "storeColumnNames": ["agg_interval", "metadata", "statistics", "plan", "index_recommendations", "execution_count", "service_latency", "cpu_sql_nanos", "contention_time", "total_estimated_execution_time"], "unique": true, "version": 4}, "privileges": {"ownerProto": "node", "users": [{"privileges": "32", "userProto": "admin", "withGrantOption": "32"}, {"privileges": "32", "userProto": "root", "withGrantOption": "32"}], "version": 2}, "replacementOf": {"time": {}}, "unexposedParentSchemaId": 29, "version": "1"}} +43 {"table": {"checks": [{"columnIds": [8], "constraintId": 2, "expr": "crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_shard_8 IN (0:::INT8, 1:::INT8, 2:::INT8, 3:::INT8, 4:::INT8, 5:::INT8, 6:::INT8, 7:::INT8)", "fromHashShardedColumn": true, "name": "check_crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_shard_8"}], "columns": [{"id": 1, "name": "aggregated_ts", "type": {"family": "TimestampTZFamily", "oid": 1184}}, {"id": 2, "name": "fingerprint_id", "type": {"family": "BytesFamily", "oid": 17}}, {"id": 3, "name": "app_name", "type": {"family": "StringFamily", "oid": 25}}, {"id": 4, "name": "node_id", "type": {"family": "IntFamily", "oid": 20, "width": 64}}, {"id": 5, "name": "agg_interval", "type": {"family": "IntervalFamily", "intervalDurationField": {}, "oid": 1186}}, {"id": 6, "name": "metadata", "type": {"family": "JsonFamily", "oid": 3802}}, {"id": 7, "name": "statistics", "type": {"family": "JsonFamily", "oid": 3802}}, {"computeExpr": "mod(fnv32(crdb_internal.datums_to_bytes(aggregated_ts, app_name, fingerprint_id, node_id)), 8:::INT8)", "hidden": true, "id": 8, "name": "crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_shard_8", "type": {"family": "IntFamily", "oid": 23, "width": 32}}, {"computeExpr": "((statistics->'statistics':::STRING)->'cnt':::STRING)::INT8", "id": 9, "name": "execution_count", "nullable": true, "type": {"family": "IntFamily", "oid": 20, "width": 64}}, {"computeExpr": "(((statistics->'statistics':::STRING)->'svcLat':::STRING)->'mean':::STRING)::FLOAT8", "id": 10, "name": "service_latency", "nullable": true, "type": {"family": "FloatFamily", "oid": 701, "width": 64}}, {"computeExpr": "(((statistics->'execution_statistics':::STRING)->'cpuSQLNanos':::STRING)->'mean':::STRING)::FLOAT8", "id": 11, "name": "cpu_sql_nanos", "nullable": true, "type": {"family": "FloatFamily", "oid": 701, "width": 64}}, {"computeExpr": "(((statistics->'execution_statistics':::STRING)->'contentionTime':::STRING)->'mean':::STRING)::FLOAT8", "id": 12, "name": "contention_time", "nullable": true, "type": {"family": "FloatFamily", "oid": 701, "width": 64}}, {"computeExpr": "((statistics->'statistics':::STRING)->'cnt':::STRING)::FLOAT8 * (((statistics->'statistics':::STRING)->'svcLat':::STRING)->>'mean':::STRING)::FLOAT8", "id": 13, "name": "total_estimated_execution_time", "nullable": true, "type": {"family": "FloatFamily", "oid": 701, "width": 64}}], "formatVersion": 3, "id": 43, "indexes": [{"foreignKey": {}, "geoConfig": {}, "id": 2, "interleave": {}, "keyColumnDirections": ["ASC"], "keyColumnIds": [2], "keyColumnNames": ["fingerprint_id"], "keySuffixColumnIds": [8, 1, 3, 4], "name": "fingerprint_stats_idx", "partitioning": {}, "sharded": {}, "version": 3}, {"foreignKey": {}, "geoConfig": {}, "id": 3, "interleave": {}, "keyColumnDirections": ["ASC", "ASC", "DESC"], "keyColumnIds": [1, 3, 9], "keyColumnNames": ["aggregated_ts", "app_name", "execution_count"], "keySuffixColumnIds": [8, 2, 4], "name": "execution_count_idx", "partitioning": {}, "predicate": "app_name NOT LIKE '$ internal%':::STRING", "sharded": {}, "version": 3}, {"compositeColumnIds": [10], "foreignKey": {}, "geoConfig": {}, "id": 4, "interleave": {}, "keyColumnDirections": ["ASC", "ASC", "DESC"], "keyColumnIds": [1, 3, 10], "keyColumnNames": ["aggregated_ts", "app_name", "service_latency"], "keySuffixColumnIds": [8, 2, 4], "name": "service_latency_idx", "partitioning": {}, "predicate": "app_name NOT LIKE '$ internal%':::STRING", "sharded": {}, "version": 3}, {"compositeColumnIds": [11], "foreignKey": {}, "geoConfig": {}, "id": 5, "interleave": {}, "keyColumnDirections": ["ASC", "ASC", "DESC"], "keyColumnIds": [1, 3, 11], "keyColumnNames": ["aggregated_ts", "app_name", "cpu_sql_nanos"], "keySuffixColumnIds": [8, 2, 4], "name": "cpu_sql_nanos_idx", "partitioning": {}, "predicate": "app_name NOT LIKE '$ internal%':::STRING", "sharded": {}, "version": 3}, {"compositeColumnIds": [12], "foreignKey": {}, "geoConfig": {}, "id": 6, "interleave": {}, "keyColumnDirections": ["ASC", "ASC", "DESC"], "keyColumnIds": [1, 3, 12], "keyColumnNames": ["aggregated_ts", "app_name", "contention_time"], "keySuffixColumnIds": [8, 2, 4], "name": "contention_time_idx", "partitioning": {}, "predicate": "app_name NOT LIKE '$ internal%':::STRING", "sharded": {}, "version": 3}, {"compositeColumnIds": [13], "foreignKey": {}, "geoConfig": {}, "id": 7, "interleave": {}, "keyColumnDirections": ["ASC", "ASC", "DESC"], "keyColumnIds": [1, 3, 13], "keyColumnNames": ["aggregated_ts", "app_name", "total_estimated_execution_time"], "keySuffixColumnIds": [8, 2, 4], "name": "total_estimated_execution_time_idx", "partitioning": {}, "predicate": "app_name NOT LIKE '$ internal%':::STRING", "sharded": {}, "version": 3}], "name": "transaction_statistics", "nextColumnId": 14, "nextConstraintId": 3, "nextIndexId": 8, "nextMutationId": 1, "parentId": 1, "primaryIndex": {"constraintId": 1, "encodingType": 1, "foreignKey": {}, "geoConfig": {}, "id": 1, "interleave": {}, "keyColumnDirections": ["ASC", "ASC", "ASC", "ASC", "ASC"], "keyColumnIds": [8, 1, 2, 3, 4], "keyColumnNames": ["crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_shard_8", "aggregated_ts", "fingerprint_id", "app_name", "node_id"], "name": "primary", "partitioning": {}, "sharded": {"columnNames": ["aggregated_ts", "app_name", "fingerprint_id", "node_id"], "isSharded": true, "name": "crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_shard_8", "shardBuckets": 8}, "storeColumnIds": [5, 6, 7, 9, 10, 11, 12, 13], "storeColumnNames": ["agg_interval", "metadata", "statistics", "execution_count", "service_latency", "cpu_sql_nanos", "contention_time", "total_estimated_execution_time"], "unique": true, "version": 4}, "privileges": {"ownerProto": "node", "users": [{"privileges": "32", "userProto": "admin", "withGrantOption": "32"}, {"privileges": "32", "userProto": "root", "withGrantOption": "32"}], "version": 2}, "replacementOf": {"time": {}}, "unexposedParentSchemaId": 29, "version": "1"}} 44 {"table": {"columns": [{"id": 1, "name": "database_id", "type": {"family": "OidFamily", "oid": 26}}, {"id": 2, "name": "role_name", "type": {"family": "StringFamily", "oid": 25}}, {"id": 3, "name": "settings", "type": {"arrayContents": {"family": "StringFamily", "oid": 25}, "arrayElemType": "StringFamily", "family": "ArrayFamily", "oid": 1009}}, {"id": 4, "name": "role_id", "type": {"family": "OidFamily", "oid": 26}}], "formatVersion": 3, "id": 44, "indexes": [{"constraintId": 1, "foreignKey": {}, "geoConfig": {}, "id": 2, "interleave": {}, "keyColumnDirections": ["ASC", "ASC"], "keyColumnIds": [1, 4], "keyColumnNames": ["database_id", "role_id"], "keySuffixColumnIds": [2], "name": "database_role_settings_database_id_role_id_key", "partitioning": {}, "sharded": {}, "storeColumnIds": [3], "storeColumnNames": ["settings"], "unique": true, "version": 3}], "name": "database_role_settings", "nextColumnId": 5, "nextConstraintId": 3, "nextIndexId": 3, "nextMutationId": 1, "parentId": 1, "primaryIndex": {"constraintId": 2, "encodingType": 1, "foreignKey": {}, "geoConfig": {}, "id": 1, "interleave": {}, "keyColumnDirections": ["ASC", "ASC"], "keyColumnIds": [1, 2], "keyColumnNames": ["database_id", "role_name"], "name": "primary", "partitioning": {}, "sharded": {}, "storeColumnIds": [3, 4], "storeColumnNames": ["settings", "role_id"], "unique": true, "version": 4}, "privileges": {"ownerProto": "node", "users": [{"privileges": "480", "userProto": "admin", "withGrantOption": "480"}, {"privileges": "480", "userProto": "root", "withGrantOption": "480"}], "version": 2}, "replacementOf": {"time": {}}, "unexposedParentSchemaId": 29, "version": "1"}} 45 {"table": {"columns": [{"id": 1, "name": "tenant_id", "type": {"family": "IntFamily", "oid": 20, "width": 64}}, {"id": 2, "name": "instance_id", "type": {"family": "IntFamily", "oid": 20, "width": 64}}, {"id": 3, "name": "next_instance_id", "type": {"family": "IntFamily", "oid": 20, "width": 64}}, {"id": 4, "name": "last_update", "type": {"family": "TimestampFamily", "oid": 1114}}, {"id": 5, "name": "ru_burst_limit", "nullable": true, "type": {"family": "FloatFamily", "oid": 701, "width": 64}}, {"id": 6, "name": "ru_refill_rate", "nullable": true, "type": {"family": "FloatFamily", "oid": 701, "width": 64}}, {"id": 7, "name": "ru_current", "nullable": true, "type": {"family": "FloatFamily", "oid": 701, "width": 64}}, {"id": 8, "name": "current_share_sum", "nullable": true, "type": {"family": "FloatFamily", "oid": 701, "width": 64}}, {"id": 9, "name": "total_consumption", "nullable": true, "type": {"family": "BytesFamily", "oid": 17}}, {"id": 10, "name": "instance_lease", "nullable": true, "type": {"family": "BytesFamily", "oid": 17}}, {"id": 11, "name": "instance_seq", "nullable": true, "type": {"family": "IntFamily", "oid": 20, "width": 64}}, {"id": 12, "name": "instance_shares", "nullable": true, "type": {"family": "FloatFamily", "oid": 701, "width": 64}}], "formatVersion": 3, "id": 45, "name": "tenant_usage", "nextColumnId": 13, "nextConstraintId": 2, "nextIndexId": 2, "nextMutationId": 1, "parentId": 1, "primaryIndex": {"constraintId": 1, "encodingType": 1, "foreignKey": {}, "geoConfig": {}, "id": 1, "interleave": {}, "keyColumnDirections": ["ASC", "ASC"], "keyColumnIds": [1, 2], "keyColumnNames": ["tenant_id", "instance_id"], "name": "primary", "partitioning": {}, "sharded": {}, "storeColumnIds": [3, 4, 5, 6, 7, 8, 9, 10, 11, 12], "storeColumnNames": ["next_instance_id", "last_update", "ru_burst_limit", "ru_refill_rate", "ru_current", "current_share_sum", "total_consumption", "instance_lease", "instance_seq", "instance_shares"], "unique": true, "version": 4}, "privileges": {"ownerProto": "node", "users": [{"privileges": "480", "userProto": "admin", "withGrantOption": "480"}, {"privileges": "480", "userProto": "root", "withGrantOption": "480"}], "version": 2}, "replacementOf": {"time": {}}, "unexposedParentSchemaId": 29, "version": "1"}} 46 {"table": {"columns": [{"id": 1, "name": "id", "type": {"family": "IntFamily", "oid": 20, "width": 64}}, {"id": 2, "name": "addr", "nullable": true, "type": {"family": "StringFamily", "oid": 25}}, {"id": 3, "name": "session_id", "nullable": true, "type": {"family": "BytesFamily", "oid": 17}}, {"id": 4, "name": "locality", "nullable": true, "type": {"family": "JsonFamily", "oid": 3802}}, {"id": 5, "name": "sql_addr", "nullable": true, "type": {"family": "StringFamily", "oid": 25}}, {"id": 6, "name": "crdb_region", "type": {"family": "BytesFamily", "oid": 17}}, {"id": 7, "name": "binary_version", "nullable": true, "type": {"family": "StringFamily", "oid": 25}}], "formatVersion": 3, "id": 46, "name": "sql_instances", "nextColumnId": 8, "nextConstraintId": 2, "nextIndexId": 3, "nextMutationId": 1, "parentId": 1, "primaryIndex": {"constraintId": 1, "encodingType": 1, "foreignKey": {}, "geoConfig": {}, "id": 2, "interleave": {}, "keyColumnDirections": ["ASC", "ASC"], "keyColumnIds": [6, 1], "keyColumnNames": ["crdb_region", "id"], "name": "primary", "partitioning": {}, "sharded": {}, "storeColumnIds": [2, 3, 4, 5, 7], "storeColumnNames": ["addr", "session_id", "locality", "sql_addr", "binary_version"], "unique": true, "version": 4}, "privileges": {"ownerProto": "node", "users": [{"privileges": "480", "userProto": "admin", "withGrantOption": "480"}, {"privileges": "480", "userProto": "root", "withGrantOption": "480"}], "version": 2}, "replacementOf": {"time": {}}, "unexposedParentSchemaId": 29, "version": "1"}} diff --git a/pkg/sql/logictest/testdata/logic_test/information_schema b/pkg/sql/logictest/testdata/logic_test/information_schema index d07e14821c30..ddec1a7eb97f 100644 --- a/pkg/sql/logictest/testdata/logic_test/information_schema +++ b/pkg/sql/logictest/testdata/logic_test/information_schema @@ -2411,7 +2411,10 @@ system public statement_diagnostics_requests statement_fingerpr system public statement_statistics agg_interval 7 system public statement_statistics aggregated_ts 1 system public statement_statistics app_name 5 +system public statement_statistics contention_time 17 +system public statement_statistics cpu_sql_nanos 16 system public statement_statistics crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_plan_hash_transaction_fingerprint_id_shard_8 11 +system public statement_statistics execution_count 14 system public statement_statistics fingerprint_id 2 system public statement_statistics index_recommendations 12 system public statement_statistics indexes_usage 13 @@ -2419,7 +2422,9 @@ system public statement_statistics metadata system public statement_statistics node_id 6 system public statement_statistics plan 10 system public statement_statistics plan_hash 4 +system public statement_statistics service_latency 15 system public statement_statistics statistics 9 +system public statement_statistics total_estimated_execution_time 18 system public statement_statistics transaction_fingerprint_id 3 system public table_statistics avgSize 10 system public table_statistics columnIDs 4 @@ -2475,11 +2480,16 @@ system public tenants service_mode system public transaction_statistics agg_interval 5 system public transaction_statistics aggregated_ts 1 system public transaction_statistics app_name 3 +system public transaction_statistics contention_time 12 +system public transaction_statistics cpu_sql_nanos 11 system public transaction_statistics crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_shard_8 8 +system public transaction_statistics execution_count 9 system public transaction_statistics fingerprint_id 2 system public transaction_statistics metadata 6 system public transaction_statistics node_id 4 +system public transaction_statistics service_latency 10 system public transaction_statistics statistics 7 +system public transaction_statistics total_estimated_execution_time 13 system public ui key 1 system public ui lastUpdated 3 system public ui value 2 diff --git a/pkg/sql/logictest/testdata/logic_test/pg_catalog b/pkg/sql/logictest/testdata/logic_test/pg_catalog index b0aee77af4ec..adf3a109191b 100644 --- a/pkg/sql/logictest/testdata/logic_test/pg_catalog +++ b/pkg/sql/logictest/testdata/logic_test/pg_catalog @@ -1123,9 +1123,14 @@ indexrelid indrelid indnatts indisunique indnullsnotdistinct indisprimary 543291292 23 2 true false false false true false true false false true false 4 5 0 0 0 0 2 2 NULL NULL 2 543291294 23 1 false false false false false false true false false true false 4 0 0 2 NULL NULL 1 543291295 23 1 false false false false false false true false false true false 5 0 0 2 NULL NULL 1 +663840560 42 3 false false false false false false true false false true false 1 5 17 0 3403232968 0 0 0 0 2 2 1 NULL app_name NOT LIKE '$ internal%'::STRING 3 +663840561 42 3 false false false false false false true false false true false 1 5 16 0 3403232968 0 0 0 0 2 2 1 NULL app_name NOT LIKE '$ internal%'::STRING 3 +663840562 42 3 false false false false false false true false false true false 1 5 15 0 3403232968 0 0 0 0 2 2 1 NULL app_name NOT LIKE '$ internal%'::STRING 3 +663840563 42 3 false false false false false false true false false true false 1 5 14 0 3403232968 0 0 0 0 2 2 1 NULL app_name NOT LIKE '$ internal%'::STRING 3 663840564 42 1 false false false false false false true false false true false 13 0 0 2 NULL NULL 1 663840565 42 2 false false false false false false true false false true false 2 3 0 0 0 0 2 2 NULL NULL 2 663840566 42 6 true false true false true false true false false true false 1 2 3 4 5 6 0 0 0 0 3403232968 0 0 0 0 0 0 0 2 2 2 2 2 2 NULL NULL 6 +663840575 42 3 false false false false false false true false false true false 1 5 18 0 3403232968 0 0 0 0 2 2 1 NULL app_name NOT LIKE '$ internal%'::STRING 3 710236230 58 1 true false true false true false true false false true false 1 3403232968 0 2 NULL NULL 1 803027558 26 3 true false true false true false true false false true false 1 2 3 0 0 3403232968 0 0 0 2 2 2 NULL NULL 3 923576837 41 1 true false true false true false true false false true false 1 0 0 2 NULL NULL 1 @@ -1177,7 +1182,12 @@ indexrelid indrelid indnatts indisunique indnullsnotdistinct indisprimary 3446785912 4 1 true false true false true false true false false true false 1 3403232968 0 2 NULL NULL 1 3446785915 4 1 true false false false true false true false false true false 4 0 0 2 NULL NULL 1 3493181576 20 2 true false true false true false true false false true false 1 2 0 0 0 0 2 2 NULL NULL 2 +3613730848 43 3 false false false false false false true false false true false 1 3 12 0 3403232968 0 0 0 0 2 2 1 NULL app_name NOT LIKE '$ internal%'::STRING 3 +3613730849 43 3 false false false false false false true false false true false 1 3 13 0 3403232968 0 0 0 0 2 2 1 NULL app_name NOT LIKE '$ internal%'::STRING 3 +3613730850 43 3 false false false false false false true false false true false 1 3 10 0 3403232968 0 0 0 0 2 2 1 NULL app_name NOT LIKE '$ internal%'::STRING 3 +3613730851 43 3 false false false false false false true false false true false 1 3 11 0 3403232968 0 0 0 0 2 2 1 NULL app_name NOT LIKE '$ internal%'::STRING 3 3613730852 43 1 false false false false false false true false false true false 2 0 0 2 NULL NULL 1 +3613730853 43 3 false false false false false false true false false true false 1 3 9 0 3403232968 0 0 0 0 2 2 1 NULL app_name NOT LIKE '$ internal%'::STRING 3 3613730855 43 4 true false true false true false true false false true false 1 2 3 4 0 0 3403232968 0 0 0 0 0 2 2 2 2 NULL NULL 4 3660126519 59 3 true false true false true false true false false true false 1 2 3 0 3403232968 0 0 0 0 2 2 2 NULL NULL 3 3706522180 11 5 true false true false true false true false false true false 5 1 2 4 3 0 0 0 0 0 0 0 0 0 0 2 2 2 2 2 NULL NULL 5 @@ -1213,6 +1223,18 @@ indexrelid operator_argument_type_oid operator_argument_position 543291292 0 2 543291294 0 1 543291295 0 1 +663840560 0 1 +663840560 0 2 +663840560 0 3 +663840561 0 1 +663840561 0 2 +663840561 0 3 +663840562 0 1 +663840562 0 2 +663840562 0 3 +663840563 0 1 +663840563 0 2 +663840563 0 3 663840564 0 1 663840565 0 1 663840565 0 2 @@ -1222,6 +1244,9 @@ indexrelid operator_argument_type_oid operator_argument_position 663840566 0 4 663840566 0 5 663840566 0 6 +663840575 0 1 +663840575 0 2 +663840575 0 3 710236230 0 1 803027558 0 1 803027558 0 2 @@ -1300,7 +1325,22 @@ indexrelid operator_argument_type_oid operator_argument_position 3446785915 0 1 3493181576 0 1 3493181576 0 2 +3613730848 0 1 +3613730848 0 2 +3613730848 0 3 +3613730849 0 1 +3613730849 0 2 +3613730849 0 3 +3613730850 0 1 +3613730850 0 2 +3613730850 0 3 +3613730851 0 1 +3613730851 0 2 +3613730851 0 3 3613730852 0 1 +3613730853 0 1 +3613730853 0 2 +3613730853 0 3 3613730855 0 1 3613730855 0 2 3613730855 0 3 diff --git a/pkg/sql/opt/exec/execbuilder/testdata/sql_statistics_persisted b/pkg/sql/opt/exec/execbuilder/testdata/sql_statistics_persisted index 2db12c00bea5..713908bcd4f6 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/sql_statistics_persisted +++ b/pkg/sql/opt/exec/execbuilder/testdata/sql_statistics_persisted @@ -104,3 +104,372 @@ SELECT * FROM crdb_internal.transaction_statistics_persisted estimated row count: 1,000 (missing stats) table: transaction_statistics@primary spans: FULL SCAN + + + +statement ok +CREATE STATISTICS system_statement_stats FROM system.statement_statistics + +query T +EXPLAIN (VERBOSE) +SELECT * FROM ((SELECT + aggregated_ts, + fingerprint_id, + transaction_fingerprint_id, + app_name, + execution_count, + service_latency, + cpu_sql_nanos, + contention_time, + total_estimated_execution_time, + metadata, + statistics +FROM system.statement_statistics +WHERE app_name NOT LIKE '$ internal%' AND aggregated_ts > ('2023-03-21 15:05'::TIMESTAMPTZ - INTERVAL '1 hour') ORDER BY execution_count DESC LIMIT 500) UNION (SELECT + aggregated_ts, + fingerprint_id, + transaction_fingerprint_id, + app_name, + execution_count, + service_latency, + cpu_sql_nanos, + contention_time, + total_estimated_execution_time, + metadata, + statistics +FROM system.statement_statistics +WHERE app_name NOT LIKE '$ internal%' AND aggregated_ts > ('2023-03-21 15:05'::TIMESTAMPTZ - INTERVAL '1 hour') ORDER BY service_latency DESC LIMIT 500) UNION (SELECT + aggregated_ts, + fingerprint_id, + transaction_fingerprint_id, + app_name, + execution_count, + service_latency, + cpu_sql_nanos, + contention_time, + total_estimated_execution_time, + metadata, + statistics +FROM system.statement_statistics +WHERE app_name NOT LIKE '$ internal%' AND aggregated_ts > ('2023-03-21 15:05'::TIMESTAMPTZ - INTERVAL '1 hour') ORDER BY cpu_sql_nanos DESC LIMIT 500) UNION (SELECT + aggregated_ts, + fingerprint_id, + transaction_fingerprint_id, + app_name, + execution_count, + service_latency, + cpu_sql_nanos, + contention_time, + total_estimated_execution_time, + metadata, + statistics +FROM system.statement_statistics +WHERE app_name NOT LIKE '$ internal%' AND aggregated_ts > ('2023-03-21 15:05'::TIMESTAMPTZ - INTERVAL '1 hour') ORDER BY contention_time DESC LIMIT 500) UNION (SELECT + aggregated_ts, + fingerprint_id, + transaction_fingerprint_id, + app_name, + execution_count, + service_latency, + cpu_sql_nanos, + contention_time, + total_estimated_execution_time, + metadata, + statistics +FROM system.statement_statistics +WHERE app_name NOT LIKE '$ internal%' AND aggregated_ts > ('2023-03-21 15:05'::TIMESTAMPTZ - INTERVAL '1 hour') ORDER BY total_estimated_execution_time DESC LIMIT 500)) +---- +distribution: local +vectorized: true +· +• union +│ columns: (aggregated_ts, fingerprint_id, transaction_fingerprint_id, app_name, execution_count, service_latency, cpu_sql_nanos, contention_time, total_estimated_execution_time, metadata, statistics) +│ estimated row count: 2 +│ +├── • union +│ │ columns: (aggregated_ts, fingerprint_id, transaction_fingerprint_id, app_name, execution_count, service_latency, cpu_sql_nanos, contention_time, total_estimated_execution_time, metadata, statistics) +│ │ estimated row count: 1 +│ │ +│ ├── • union +│ │ │ columns: (aggregated_ts, fingerprint_id, transaction_fingerprint_id, app_name, execution_count, service_latency, cpu_sql_nanos, contention_time, total_estimated_execution_time, metadata, statistics) +│ │ │ estimated row count: 1 +│ │ │ +│ │ ├── • union +│ │ │ │ columns: (aggregated_ts, fingerprint_id, transaction_fingerprint_id, app_name, execution_count, service_latency, cpu_sql_nanos, contention_time, total_estimated_execution_time, metadata, statistics) +│ │ │ │ estimated row count: 1 +│ │ │ │ +│ │ │ ├── • index join +│ │ │ │ │ columns: (aggregated_ts, fingerprint_id, transaction_fingerprint_id, app_name, execution_count, service_latency, cpu_sql_nanos, contention_time, total_estimated_execution_time, metadata, statistics) +│ │ │ │ │ estimated row count: 0 +│ │ │ │ │ table: statement_statistics@primary +│ │ │ │ │ key columns: crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_plan_hash_transaction_fingerprint_id_shard_8, aggregated_ts, fingerprint_id, transaction_fingerprint_id, plan_hash, app_name, node_id +│ │ │ │ │ +│ │ │ │ └── • top-k +│ │ │ │ │ columns: (aggregated_ts, fingerprint_id, transaction_fingerprint_id, plan_hash, app_name, node_id, crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_plan_hash_transaction_fingerprint_id_shard_8, execution_count) +│ │ │ │ │ ordering: -execution_count +│ │ │ │ │ estimated row count: 0 +│ │ │ │ │ order: -execution_count +│ │ │ │ │ k: 500 +│ │ │ │ │ +│ │ │ │ └── • scan +│ │ │ │ columns: (aggregated_ts, fingerprint_id, transaction_fingerprint_id, plan_hash, app_name, node_id, crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_plan_hash_transaction_fingerprint_id_shard_8, execution_count) +│ │ │ │ estimated row count: 0 (33% of the table; stats collected ago) +│ │ │ │ table: statement_statistics@execution_count_idx (partial index) +│ │ │ │ spans: /2023-03-21T14:05:00.000001Z- +│ │ │ │ +│ │ │ └── • index join +│ │ │ │ columns: (aggregated_ts, fingerprint_id, transaction_fingerprint_id, app_name, execution_count, service_latency, cpu_sql_nanos, contention_time, total_estimated_execution_time, metadata, statistics) +│ │ │ │ estimated row count: 0 +│ │ │ │ table: statement_statistics@primary +│ │ │ │ key columns: crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_plan_hash_transaction_fingerprint_id_shard_8, aggregated_ts, fingerprint_id, transaction_fingerprint_id, plan_hash, app_name, node_id +│ │ │ │ +│ │ │ └── • top-k +│ │ │ │ columns: (aggregated_ts, fingerprint_id, transaction_fingerprint_id, plan_hash, app_name, node_id, crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_plan_hash_transaction_fingerprint_id_shard_8, service_latency) +│ │ │ │ ordering: -service_latency +│ │ │ │ estimated row count: 0 +│ │ │ │ order: -service_latency +│ │ │ │ k: 500 +│ │ │ │ +│ │ │ └── • scan +│ │ │ columns: (aggregated_ts, fingerprint_id, transaction_fingerprint_id, plan_hash, app_name, node_id, crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_plan_hash_transaction_fingerprint_id_shard_8, service_latency) +│ │ │ estimated row count: 0 (33% of the table; stats collected ago) +│ │ │ table: statement_statistics@service_latency_idx (partial index) +│ │ │ spans: /2023-03-21T14:05:00.000001Z- +│ │ │ +│ │ └── • index join +│ │ │ columns: (aggregated_ts, fingerprint_id, transaction_fingerprint_id, app_name, execution_count, service_latency, cpu_sql_nanos, contention_time, total_estimated_execution_time, metadata, statistics) +│ │ │ estimated row count: 0 +│ │ │ table: statement_statistics@primary +│ │ │ key columns: crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_plan_hash_transaction_fingerprint_id_shard_8, aggregated_ts, fingerprint_id, transaction_fingerprint_id, plan_hash, app_name, node_id +│ │ │ +│ │ └── • top-k +│ │ │ columns: (aggregated_ts, fingerprint_id, transaction_fingerprint_id, plan_hash, app_name, node_id, crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_plan_hash_transaction_fingerprint_id_shard_8, cpu_sql_nanos) +│ │ │ ordering: -cpu_sql_nanos +│ │ │ estimated row count: 0 +│ │ │ order: -cpu_sql_nanos +│ │ │ k: 500 +│ │ │ +│ │ └── • scan +│ │ columns: (aggregated_ts, fingerprint_id, transaction_fingerprint_id, plan_hash, app_name, node_id, crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_plan_hash_transaction_fingerprint_id_shard_8, cpu_sql_nanos) +│ │ estimated row count: 0 (33% of the table; stats collected ago) +│ │ table: statement_statistics@cpu_sql_nanos_idx (partial index) +│ │ spans: /2023-03-21T14:05:00.000001Z- +│ │ +│ └── • index join +│ │ columns: (aggregated_ts, fingerprint_id, transaction_fingerprint_id, app_name, execution_count, service_latency, cpu_sql_nanos, contention_time, total_estimated_execution_time, metadata, statistics) +│ │ estimated row count: 0 +│ │ table: statement_statistics@primary +│ │ key columns: crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_plan_hash_transaction_fingerprint_id_shard_8, aggregated_ts, fingerprint_id, transaction_fingerprint_id, plan_hash, app_name, node_id +│ │ +│ └── • top-k +│ │ columns: (aggregated_ts, fingerprint_id, transaction_fingerprint_id, plan_hash, app_name, node_id, crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_plan_hash_transaction_fingerprint_id_shard_8, contention_time) +│ │ ordering: -contention_time +│ │ estimated row count: 0 +│ │ order: -contention_time +│ │ k: 500 +│ │ +│ └── • scan +│ columns: (aggregated_ts, fingerprint_id, transaction_fingerprint_id, plan_hash, app_name, node_id, crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_plan_hash_transaction_fingerprint_id_shard_8, contention_time) +│ estimated row count: 0 (33% of the table; stats collected ago) +│ table: statement_statistics@contention_time_idx (partial index) +│ spans: /2023-03-21T14:05:00.000001Z- +│ +└── • index join + │ columns: (aggregated_ts, fingerprint_id, transaction_fingerprint_id, app_name, execution_count, service_latency, cpu_sql_nanos, contention_time, total_estimated_execution_time, metadata, statistics) + │ estimated row count: 0 + │ table: statement_statistics@primary + │ key columns: crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_plan_hash_transaction_fingerprint_id_shard_8, aggregated_ts, fingerprint_id, transaction_fingerprint_id, plan_hash, app_name, node_id + │ + └── • top-k + │ columns: (aggregated_ts, fingerprint_id, transaction_fingerprint_id, plan_hash, app_name, node_id, crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_plan_hash_transaction_fingerprint_id_shard_8, total_estimated_execution_time) + │ ordering: -total_estimated_execution_time + │ estimated row count: 0 + │ order: -total_estimated_execution_time + │ k: 500 + │ + └── • scan + columns: (aggregated_ts, fingerprint_id, transaction_fingerprint_id, plan_hash, app_name, node_id, crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_plan_hash_transaction_fingerprint_id_shard_8, total_estimated_execution_time) + estimated row count: 0 (33% of the table; stats collected ago) + table: statement_statistics@total_estimated_execution_time_idx (partial index) + spans: /2023-03-21T14:05:00.000001Z- + +statement ok +CREATE STATISTICS system_transaction_stats FROM system.transaction_statistics + +query T +EXPLAIN (VERBOSE) +SELECT * FROM ((SELECT + aggregated_ts, + fingerprint_id, + app_name, + execution_count, + service_latency, + cpu_sql_nanos, + contention_time, + total_estimated_execution_time, + metadata, + statistics +FROM system.transaction_statistics +WHERE app_name NOT LIKE '$ internal%' AND aggregated_ts > ('2023-03-21 15:05'::TIMESTAMPTZ - INTERVAL '1 hour') ORDER BY execution_count DESC LIMIT 500) UNION (SELECT + aggregated_ts, + fingerprint_id, + app_name, + execution_count, + service_latency, + cpu_sql_nanos, + contention_time, + total_estimated_execution_time, + metadata, + statistics +FROM system.transaction_statistics +WHERE app_name NOT LIKE '$ internal%' AND aggregated_ts > ('2023-03-21 15:05'::TIMESTAMPTZ - INTERVAL '1 hour') ORDER BY service_latency DESC LIMIT 500) UNION (SELECT + aggregated_ts, + fingerprint_id, + app_name, + execution_count, + service_latency, + cpu_sql_nanos, + contention_time, + total_estimated_execution_time, + metadata, + statistics +FROM system.transaction_statistics +WHERE app_name NOT LIKE '$ internal%' AND aggregated_ts > ('2023-03-21 15:05'::TIMESTAMPTZ - INTERVAL '1 hour') ORDER BY cpu_sql_nanos DESC LIMIT 500) UNION (SELECT + aggregated_ts, + fingerprint_id, + app_name, + execution_count, + service_latency, + cpu_sql_nanos, + contention_time, + total_estimated_execution_time, + metadata, + statistics +FROM system.transaction_statistics +WHERE app_name NOT LIKE '$ internal%' AND aggregated_ts > ('2023-03-21 15:05'::TIMESTAMPTZ - INTERVAL '1 hour') ORDER BY contention_time DESC LIMIT 500) UNION (SELECT + aggregated_ts, + fingerprint_id, + app_name, + execution_count, + service_latency, + cpu_sql_nanos, + contention_time, + total_estimated_execution_time, + metadata, + statistics +FROM system.transaction_statistics +WHERE app_name NOT LIKE '$ internal%' AND aggregated_ts > ('2023-03-21 15:05'::TIMESTAMPTZ- INTERVAL '1 hour') ORDER BY total_estimated_execution_time DESC LIMIT 500)) +---- +distribution: local +vectorized: true +· +• union +│ columns: (aggregated_ts, fingerprint_id, app_name, execution_count, service_latency, cpu_sql_nanos, contention_time, total_estimated_execution_time, metadata, statistics) +│ estimated row count: 2 +│ +├── • union +│ │ columns: (aggregated_ts, fingerprint_id, app_name, execution_count, service_latency, cpu_sql_nanos, contention_time, total_estimated_execution_time, metadata, statistics) +│ │ estimated row count: 1 +│ │ +│ ├── • union +│ │ │ columns: (aggregated_ts, fingerprint_id, app_name, execution_count, service_latency, cpu_sql_nanos, contention_time, total_estimated_execution_time, metadata, statistics) +│ │ │ estimated row count: 1 +│ │ │ +│ │ ├── • union +│ │ │ │ columns: (aggregated_ts, fingerprint_id, app_name, execution_count, service_latency, cpu_sql_nanos, contention_time, total_estimated_execution_time, metadata, statistics) +│ │ │ │ estimated row count: 1 +│ │ │ │ +│ │ │ ├── • index join +│ │ │ │ │ columns: (aggregated_ts, fingerprint_id, app_name, execution_count, service_latency, cpu_sql_nanos, contention_time, total_estimated_execution_time, metadata, statistics) +│ │ │ │ │ estimated row count: 0 +│ │ │ │ │ table: transaction_statistics@primary +│ │ │ │ │ key columns: crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_shard_8, aggregated_ts, fingerprint_id, app_name, node_id +│ │ │ │ │ +│ │ │ │ └── • top-k +│ │ │ │ │ columns: (aggregated_ts, fingerprint_id, app_name, node_id, crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_shard_8, execution_count) +│ │ │ │ │ ordering: -execution_count +│ │ │ │ │ estimated row count: 0 +│ │ │ │ │ order: -execution_count +│ │ │ │ │ k: 500 +│ │ │ │ │ +│ │ │ │ └── • scan +│ │ │ │ columns: (aggregated_ts, fingerprint_id, app_name, node_id, crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_shard_8, execution_count) +│ │ │ │ estimated row count: 0 (33% of the table; stats collected ago) +│ │ │ │ table: transaction_statistics@execution_count_idx (partial index) +│ │ │ │ spans: /2023-03-21T14:05:00.000001Z- +│ │ │ │ +│ │ │ └── • index join +│ │ │ │ columns: (aggregated_ts, fingerprint_id, app_name, execution_count, service_latency, cpu_sql_nanos, contention_time, total_estimated_execution_time, metadata, statistics) +│ │ │ │ estimated row count: 0 +│ │ │ │ table: transaction_statistics@primary +│ │ │ │ key columns: crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_shard_8, aggregated_ts, fingerprint_id, app_name, node_id +│ │ │ │ +│ │ │ └── • top-k +│ │ │ │ columns: (aggregated_ts, fingerprint_id, app_name, node_id, crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_shard_8, service_latency) +│ │ │ │ ordering: -service_latency +│ │ │ │ estimated row count: 0 +│ │ │ │ order: -service_latency +│ │ │ │ k: 500 +│ │ │ │ +│ │ │ └── • scan +│ │ │ columns: (aggregated_ts, fingerprint_id, app_name, node_id, crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_shard_8, service_latency) +│ │ │ estimated row count: 0 (33% of the table; stats collected ago) +│ │ │ table: transaction_statistics@service_latency_idx (partial index) +│ │ │ spans: /2023-03-21T14:05:00.000001Z- +│ │ │ +│ │ └── • index join +│ │ │ columns: (aggregated_ts, fingerprint_id, app_name, execution_count, service_latency, cpu_sql_nanos, contention_time, total_estimated_execution_time, metadata, statistics) +│ │ │ estimated row count: 0 +│ │ │ table: transaction_statistics@primary +│ │ │ key columns: crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_shard_8, aggregated_ts, fingerprint_id, app_name, node_id +│ │ │ +│ │ └── • top-k +│ │ │ columns: (aggregated_ts, fingerprint_id, app_name, node_id, crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_shard_8, cpu_sql_nanos) +│ │ │ ordering: -cpu_sql_nanos +│ │ │ estimated row count: 0 +│ │ │ order: -cpu_sql_nanos +│ │ │ k: 500 +│ │ │ +│ │ └── • scan +│ │ columns: (aggregated_ts, fingerprint_id, app_name, node_id, crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_shard_8, cpu_sql_nanos) +│ │ estimated row count: 0 (33% of the table; stats collected ago) +│ │ table: transaction_statistics@cpu_sql_nanos_idx (partial index) +│ │ spans: /2023-03-21T14:05:00.000001Z- +│ │ +│ └── • index join +│ │ columns: (aggregated_ts, fingerprint_id, app_name, execution_count, service_latency, cpu_sql_nanos, contention_time, total_estimated_execution_time, metadata, statistics) +│ │ estimated row count: 0 +│ │ table: transaction_statistics@primary +│ │ key columns: crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_shard_8, aggregated_ts, fingerprint_id, app_name, node_id +│ │ +│ └── • top-k +│ │ columns: (aggregated_ts, fingerprint_id, app_name, node_id, crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_shard_8, contention_time) +│ │ ordering: -contention_time +│ │ estimated row count: 0 +│ │ order: -contention_time +│ │ k: 500 +│ │ +│ └── • scan +│ columns: (aggregated_ts, fingerprint_id, app_name, node_id, crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_shard_8, contention_time) +│ estimated row count: 0 (33% of the table; stats collected ago) +│ table: transaction_statistics@contention_time_idx (partial index) +│ spans: /2023-03-21T14:05:00.000001Z- +│ +└── • index join + │ columns: (aggregated_ts, fingerprint_id, app_name, execution_count, service_latency, cpu_sql_nanos, contention_time, total_estimated_execution_time, metadata, statistics) + │ estimated row count: 0 + │ table: transaction_statistics@primary + │ key columns: crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_shard_8, aggregated_ts, fingerprint_id, app_name, node_id + │ + └── • top-k + │ columns: (aggregated_ts, fingerprint_id, app_name, node_id, crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_shard_8, total_estimated_execution_time) + │ ordering: -total_estimated_execution_time + │ estimated row count: 0 + │ order: -total_estimated_execution_time + │ k: 500 + │ + └── • scan + columns: (aggregated_ts, fingerprint_id, app_name, node_id, crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_shard_8, total_estimated_execution_time) + estimated row count: 0 (33% of the table; stats collected ago) + table: transaction_statistics@total_estimated_execution_time_idx (partial index) + spans: /2023-03-21T14:05:00.000001Z- diff --git a/pkg/sql/sqlstats/persistedsqlstats/BUILD.bazel b/pkg/sql/sqlstats/persistedsqlstats/BUILD.bazel index df13b9e5e71a..ad4ad83bca8d 100644 --- a/pkg/sql/sqlstats/persistedsqlstats/BUILD.bazel +++ b/pkg/sql/sqlstats/persistedsqlstats/BUILD.bazel @@ -102,6 +102,7 @@ go_test( "//pkg/util/leaktest", "//pkg/util/log", "//pkg/util/metric", + "//pkg/util/randutil", "//pkg/util/stop", "//pkg/util/syncutil", "//pkg/util/timeutil", diff --git a/pkg/sql/sqlstats/persistedsqlstats/bench_test.go b/pkg/sql/sqlstats/persistedsqlstats/bench_test.go index 0a8c7cd2d030..3783793f5c6b 100644 --- a/pkg/sql/sqlstats/persistedsqlstats/bench_test.go +++ b/pkg/sql/sqlstats/persistedsqlstats/bench_test.go @@ -11,18 +11,23 @@ package persistedsqlstats_test import ( + "bytes" "context" gosql "database/sql" "fmt" + "strings" "sync" "testing" "github.com/cockroachdb/cockroach/pkg/base" "github.com/cockroachdb/cockroach/pkg/sql" + "github.com/cockroachdb/cockroach/pkg/sql/sqlstats/persistedsqlstats" "github.com/cockroachdb/cockroach/pkg/testutils/serverutils" "github.com/cockroachdb/cockroach/pkg/testutils/skip" "github.com/cockroachdb/cockroach/pkg/testutils/sqlutils" + "github.com/cockroachdb/cockroach/pkg/testutils/testcluster" "github.com/cockroachdb/cockroach/pkg/util/log" + "github.com/cockroachdb/cockroach/pkg/util/randutil" "github.com/cockroachdb/cockroach/pkg/util/timeutil" ) @@ -79,3 +84,231 @@ func BenchmarkConcurrentSelect1(b *testing.B) { }) } } + +// runBenchmarkPersistedSqlStatsFlush benchmarks the persisted stats +func runBenchmarkPersistedSqlStatsFlush( + b *testing.B, tc *testcluster.TestCluster, db *sqlutils.SQLRunner, ctx context.Context, +) { + rng := randutil.NewTestRandWithSeed(0) + const charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" + b.ResetTimer() + for i := 0; i < b.N; i++ { + // Select 3000 rows + for j := 0; j < 3000; j++ { + appName := randutil.RandString(rng, 5, charset) + db.Exec(b, fmt.Sprintf("SET application_name='%s'", appName)) + db.Exec(b, "SELECT id FROM bench.t1 LIMIT 5") + } + b.StartTimer() + tc.Server(0).SQLServer().(*sql.Server).GetSQLStatsProvider().(*persistedsqlstats.PersistedSQLStats).Flush(ctx) + b.StopTimer() + } +} + +// runBenchmarkPersistedSqlStatsSelects benchmarks select statements +func runBenchmarkPersistedSqlStatsSelects(b *testing.B, db *sqlutils.SQLRunner, query string) { + b.ResetTimer() + for i := 0; i < b.N; i++ { + b.StartTimer() + rows := db.Query(b, query) + if err := rows.Err(); err != nil { + b.Fatal(err) + } + rows.Close() + b.StopTimer() + } +} + +// BenchmarkSqlStatsPersisted tests measures the performance of persisted statistics. +func BenchmarkSqlStatsPersisted(b *testing.B) { + skip.UnderShort(b) + defer log.Scope(b).Close(b) + + type clusterCreationFn func() (*sqlutils.SQLRunner, *testcluster.TestCluster) + type clusterSpec struct { + name string + create clusterCreationFn + } + for _, cluster := range []clusterSpec{ + { + name: "3node", + create: func() (*sqlutils.SQLRunner, *testcluster.TestCluster) { + tc := testcluster.StartTestCluster(b, 3, + base.TestClusterArgs{ + ReplicationMode: base.ReplicationAuto, + ServerArgs: base.TestServerArgs{ + UseDatabase: "bench", + SQLMemoryPoolSize: 512 << 20, + }, + }) + sqlRunner := sqlutils.MakeRoundRobinSQLRunner(tc.Conns[0], tc.Conns[1], tc.Conns[2]) + return sqlRunner, tc + }, + }, + { + name: "6node", + create: func() (*sqlutils.SQLRunner, *testcluster.TestCluster) { + tc := testcluster.StartTestCluster(b, 6, + base.TestClusterArgs{ + ReplicationMode: base.ReplicationAuto, + ServerArgs: base.TestServerArgs{ + UseDatabase: "bench", + SQLMemoryPoolSize: 512 << 20, + }, + }) + sqlRunner := sqlutils.MakeRoundRobinSQLRunner(tc.Conns[0], tc.Conns[1], tc.Conns[2], tc.Conns[3], + tc.Conns[4], tc.Conns[5]) + return sqlRunner, tc + }, + }, + } { + b.Run(cluster.name, func(b *testing.B) { + type testSpec struct { + // array of computed columns + computedColumns []string + } + for _, test := range []testSpec{ + {computedColumns: []string{"execution_count", "service_latency", "cpu_sql_nanos", "contention_time", "total_estimated_execution_time"}}, + {computedColumns: []string{"execution_count", "service_latency", "cpu_sql_nanos", "contention_time", "total_estimated_execution_time"}}, + {computedColumns: []string{"execution_count", "service_latency", "cpu_sql_nanos", "contention_time"}}, + {computedColumns: []string{"execution_count", "service_latency", "cpu_sql_nanos", "contention_time"}}, + {computedColumns: []string{"execution_count", "service_latency", "cpu_sql_nanos"}}, + {computedColumns: []string{"execution_count", "service_latency"}}, + {computedColumns: []string{"execution_count"}}, + {computedColumns: []string{}}, + } { + + // compute expressions + executionCount := "((statistics->'statistics'->'cnt')::INT8)" + serviceLatency := "((statistics->'statistics'->'svcLat'->'mean')::FLOAT)" + cpuSqlNanos := "((statistics->'execution_statistics'->'cpuSQLNanos'->'mean')::FLOAT)" + contentionTime := "((statistics->'execution_statistics'->'contentionTime'->'mean')::FLOAT)" + totalEstimatedExecutionTime := "(statistics->'statistics'->>'cnt')::FLOAT * (statistics->'statistics'->'svcLat'->>'mean')::FLOAT" + computeExpressions := []string{executionCount, serviceLatency, cpuSqlNanos, contentionTime, totalEstimatedExecutionTime} + + // Indexes + executionCountIdx := "execution_count_idx" + serviceLatencyIdx := "service_latency_idx" + sqlCpuNanosIdx := "cpu_sql_nanos_idx" + contentionTimeIdx := "contention_time_idx" + totalEstimatedExecutionTimeIdx := "total_estimated_execution_time_idx" + + // DROP INDEX queries + dropExecutionCountIdx := fmt.Sprintf("DROP INDEX system.transaction_statistics@%s; DROP INDEX system.statement_statistics@%s;", executionCountIdx, executionCountIdx) + dropServiceLatencyIdx := fmt.Sprintf("DROP INDEX system.transaction_statistics@%s; DROP INDEX system.statement_statistics@%s;", serviceLatencyIdx, serviceLatencyIdx) + dropSqlCpuNanosIdx := fmt.Sprintf("DROP INDEX system.transaction_statistics@%s; DROP INDEX system.statement_statistics@%s;", sqlCpuNanosIdx, sqlCpuNanosIdx) + dropContentionTimeIdx := fmt.Sprintf("DROP INDEX system.transaction_statistics@%s; DROP INDEX system.statement_statistics@%s;", contentionTimeIdx, contentionTimeIdx) + dropTotalEstimatedExecutionTimeIdx := fmt.Sprintf("DROP INDEX system.transaction_statistics@%s; DROP INDEX system.statement_statistics@%s;", totalEstimatedExecutionTimeIdx, totalEstimatedExecutionTimeIdx) + dropQueries := []string{dropExecutionCountIdx, dropServiceLatencyIdx, dropSqlCpuNanosIdx, dropContentionTimeIdx, dropTotalEstimatedExecutionTimeIdx} + + var name strings.Builder + if test.computedColumns == nil { + name.WriteString("computedColumns=none") + } else { + name.WriteString(fmt.Sprintf("computedColumns=%d", len(test.computedColumns))) + } + for i, val := range test.computedColumns { + if i > len(dropQueries) { + dropQueries = []string{} + } else { + dropQueries = dropQueries[1:] + } + computeExpressions[i] = val + } + var selectQueries []string + for i := range computeExpressions { + orderClause := fmt.Sprintf(" ORDER BY %s DESC LIMIT 500", computeExpressions[i]) + baseQuery := fmt.Sprintf(`SELECT + app_name, + aggregated_ts, + fingerprint_id, + %s, + %s, + %s, + %s, + %s, + metadata, + statistics + FROM system.transaction_statistics + WHERE app_name NOT LIKE '$ internal%%' AND aggregated_ts > (now() - INTERVAL '1 hour') %s`, + computeExpressions[0], + computeExpressions[1], + computeExpressions[2], + computeExpressions[3], + computeExpressions[4], + orderClause) + selectQueries = append(selectQueries, baseQuery) + } + txnStatsQuery := fmt.Sprintf("SELECT * FROM ((%s) UNION (%s) UNION (%s) UNION (%s) UNION (%s))", + selectQueries[0], selectQueries[1], selectQueries[2], selectQueries[3], selectQueries[4]) + + selectQueries = []string{} + for i := range computeExpressions { + orderClause := fmt.Sprintf(" ORDER BY %s DESC LIMIT 500", computeExpressions[i]) + baseQuery := fmt.Sprintf(`SELECT + app_name, + aggregated_ts, + fingerprint_id, + transaction_fingerprint_id, + %s, + %s, + %s, + %s, + %s, + metadata, + statistics + FROM system.statement_statistics + WHERE app_name NOT LIKE '$ internal%%' AND aggregated_ts > (now() - INTERVAL '1 hour') %s`, + computeExpressions[0], + computeExpressions[1], + computeExpressions[2], + computeExpressions[3], + computeExpressions[4], + orderClause) + selectQueries = append(selectQueries, baseQuery) + } + stmtStatsQuery := fmt.Sprintf("SELECT * FROM ((%s) UNION (%s) UNION (%s) UNION (%s) UNION (%s))", + selectQueries[0], selectQueries[1], selectQueries[2], selectQueries[3], selectQueries[4]) + b.Run(name.String(), func(b *testing.B) { + ctx := context.Background() + sqlRunner, tc := cluster.create() + defer tc.Stopper().Stop(ctx) + sqlRunner.Exec(b, `INSERT INTO system.users VALUES ('node', NULL, true, 3)`) + sqlRunner.Exec(b, `GRANT node TO root`) + sqlRunner.Exec(b, `CREATE DATABASE IF NOT EXISTS bench`) + for _, query := range dropQueries { + sqlRunner.Exec(b, query) + } + sqlRunner.Exec(b, "CREATE TABLE bench.t1 (id UUID PRIMARY KEY NOT NULL DEFAULT gen_random_uuid())") + + // Insert 10000 rows + var buf bytes.Buffer + buf.WriteString("INSERT INTO bench.t1 (id) VALUES (DEFAULT)") + for j := 0; j < 10000; j++ { + if j > 0 { + buf.WriteString(", (DEFAULT)") + } + } + sqlRunner.Exec(b, buf.String()) + buf.Reset() + + b.ReportAllocs() + // Run flush benchmark first to initialize stats tables + b.Run("BenchmarkPersistedSqlStatsFlush", func(b *testing.B) { + runBenchmarkPersistedSqlStatsFlush(b, tc, sqlRunner, ctx) + }) + + // Run flush benchmark first to initialize stats tables + b.Run("BenchmarkPersistedSqlStatsSelectStatements", func(b *testing.B) { + runBenchmarkPersistedSqlStatsSelects(b, sqlRunner, stmtStatsQuery) + }) + + // Run flush benchmark first to initialize stats tables + b.Run("BenchmarkPersistedSqlStatsSelectTransactions", func(b *testing.B) { + runBenchmarkPersistedSqlStatsSelects(b, sqlRunner, txnStatsQuery) + }) + }) + } + }) + } +} diff --git a/pkg/upgrade/upgrades/BUILD.bazel b/pkg/upgrade/upgrades/BUILD.bazel index 20d8bc714ff0..e11f8a41c1bb 100644 --- a/pkg/upgrade/upgrades/BUILD.bazel +++ b/pkg/upgrade/upgrades/BUILD.bazel @@ -9,6 +9,7 @@ go_library( "alter_table_statistics_partial_predicate_and_id.go", "backfill_jobs_info_table_migration.go", "create_auto_config_runner_job.go", + "create_computed_indexes_sql_statistics.go", "create_index_usage_statement_statistics.go", "create_jobs_metrics_polling_job.go", "create_task_system_tables.go", @@ -93,6 +94,7 @@ go_test( "backfill_jobs_info_table_migration_test.go", "builtins_test.go", "create_auto_config_runner_job_test.go", + "create_computed_indexes_sql_statistics_test.go", "create_index_usage_statement_statistics_test.go", "create_jobs_metrics_polling_job_test.go", "database_role_settings_table_user_id_migration_test.go", diff --git a/pkg/upgrade/upgrades/create_computed_indexes_sql_statistics.go b/pkg/upgrade/upgrades/create_computed_indexes_sql_statistics.go new file mode 100644 index 000000000000..3cdbc88ac2ca --- /dev/null +++ b/pkg/upgrade/upgrades/create_computed_indexes_sql_statistics.go @@ -0,0 +1,274 @@ +// Copyright 2023 The Cockroach Authors. +// +// Use of this software is governed by the Business Source License +// included in the file licenses/BSL.txt. +// +// As of the Change Date specified in that file, in accordance with +// the Business Source License, use of this software will be governed +// by the Apache License, Version 2.0, included in the file +// licenses/APL.txt. + +package upgrades + +import ( + "context" + + "github.com/cockroachdb/cockroach/pkg/clusterversion" + "github.com/cockroachdb/cockroach/pkg/keys" + "github.com/cockroachdb/cockroach/pkg/sql/catalog/systemschema" + "github.com/cockroachdb/cockroach/pkg/upgrade" +) + +const addExecutionCountComputedColStmtStats = ` +ALTER TABLE system.statement_statistics +ADD COLUMN IF NOT EXISTS "execution_count" INT8 +AS ((statistics->'statistics'->'cnt')::INT8) STORED +` + +const addIndexOnExecutionCountComputedColStmtStats = ` +CREATE INDEX execution_count_idx ON system.statement_statistics ( +aggregated_ts, app_name, execution_count DESC) WHERE app_name NOT LIKE +'$ internal%' +` +const addServiceLatencyComputedColStmtStats = ` +ALTER TABLE system.statement_statistics +ADD COLUMN IF NOT EXISTS "service_latency" FLOAT +AS ((statistics->'statistics'->'svcLat'->'mean')::FLOAT) STORED +` + +const addIndexOnServiceLatencyComputedColStmtStats = ` +CREATE INDEX service_latency_idx ON system.statement_statistics ( +aggregated_ts, app_name, service_latency DESC) WHERE app_name NOT LIKE +'$ internal%' +` +const addCpuSqlNanosComputedColStmtStats = ` +ALTER TABLE system.statement_statistics +ADD COLUMN IF NOT EXISTS "cpu_sql_nanos" FLOAT +AS ((statistics->'execution_statistics'->'cpuSQLNanos'->'mean')::FLOAT) STORED +` + +const addIndexOnCpuSqlNanosComputedColStmtStats = ` +CREATE INDEX cpu_sql_nanos_idx ON system.statement_statistics ( +aggregated_ts, app_name, cpu_sql_nanos DESC) WHERE app_name NOT LIKE +'$ internal%' +` +const addContentionTimeComputedColStmtStats = ` +ALTER TABLE system.statement_statistics +ADD COLUMN IF NOT EXISTS "contention_time" FLOAT +AS ((statistics->'execution_statistics'->'contentionTime'->'mean')::FLOAT) STORED +` + +const addIndexOnContentionTimeComputedColStmtStats = ` +CREATE INDEX contention_time_idx ON system.statement_statistics ( +aggregated_ts, app_name, contention_time DESC) WHERE app_name NOT LIKE +'$ internal%' +` +const addTotalEstimatedExecutionTimeComputedColStmtStats = ` +ALTER TABLE system.statement_statistics +ADD COLUMN IF NOT EXISTS "total_estimated_execution_time" FLOAT +AS ((statistics->'statistics'->>'cnt')::FLOAT * (statistics->'statistics'->'svcLat'->>'mean')::FLOAT) STORED +` + +const addIndexOnTotalEstimatedExecutionTimeComputedColStmtStats = ` +CREATE INDEX total_estimated_execution_time_idx ON system.statement_statistics ( +aggregated_ts, app_name, total_estimated_execution_time DESC) WHERE app_name NOT LIKE +'$ internal%' +` + +// transaction_statistics +const addExecutionCountComputedColTxnStats = ` +ALTER TABLE system.transaction_statistics +ADD COLUMN IF NOT EXISTS "execution_count" INT8 +AS ((statistics->'statistics'->'cnt')::INT8) STORED +` + +const addIndexOnExecutionCountComputedColTxnStats = ` +CREATE INDEX execution_count_idx ON system.transaction_statistics ( +aggregated_ts, app_name, execution_count DESC) WHERE app_name NOT LIKE +'$ internal%' +` +const addServiceLatencyComputedColTxnStats = ` +ALTER TABLE system.transaction_statistics +ADD COLUMN IF NOT EXISTS "service_latency" FLOAT +AS ((statistics->'statistics'->'svcLat'->'mean')::FLOAT) STORED +` + +const addIndexOnServiceLatencyComputedColTxnStats = ` +CREATE INDEX service_latency_idx ON system.transaction_statistics ( +aggregated_ts, app_name, service_latency DESC) WHERE app_name NOT LIKE +'$ internal%' +` +const addCpuSqlNanosComputedColTxnStats = ` +ALTER TABLE system.transaction_statistics +ADD COLUMN IF NOT EXISTS "cpu_sql_nanos" FLOAT +AS ((statistics->'execution_statistics'->'cpuSQLNanos'->'mean')::FLOAT) STORED +` + +const addIndexOnCpuSqlNanosComputedColTxnStats = ` +CREATE INDEX cpu_sql_nanos_idx ON system.transaction_statistics ( +aggregated_ts, app_name, cpu_sql_nanos DESC) WHERE app_name NOT LIKE +'$ internal%' +` +const addContentionTimeComputedColTxnStats = ` +ALTER TABLE system.transaction_statistics +ADD COLUMN IF NOT EXISTS "contention_time" FLOAT +AS ((statistics->'execution_statistics'->'contentionTime'->'mean')::FLOAT) STORED +` + +const addIndexOnContentionTimeComputedColTxnStats = ` +CREATE INDEX contention_time_idx ON system.transaction_statistics ( +aggregated_ts, app_name, contention_time DESC) WHERE app_name NOT LIKE +'$ internal%' +` +const addTotalEstimatedExecutionTimeComputedColTxnStats = ` +ALTER TABLE system.transaction_statistics +ADD COLUMN IF NOT EXISTS "total_estimated_execution_time" FLOAT +AS ((statistics->'statistics'->>'cnt')::FLOAT * ( +statistics->'statistics'->'svcLat'->>'mean')::FLOAT) STORED +` + +const addIndexOnTotalEstimatedExecutionTimeComputedColTxnStats = ` +CREATE INDEX total_estimated_execution_time_idx ON system.transaction_statistics ( +aggregated_ts, app_name, total_estimated_execution_time DESC) WHERE app_name NOT LIKE +'$ internal%' +` + +func createComputedIndexesOnSystemSQLStatistics( + ctx context.Context, cs clusterversion.ClusterVersion, d upgrade.TenantDeps, +) error { + for _, op := range []operation{ + { + name: "create-execution-count-computed-col-stmt-stats", + schemaList: []string{"execution_count"}, + query: addExecutionCountComputedColStmtStats, + schemaExistsFn: hasColumn, + }, + { + name: "create-execution-count-idx-stmt-stats", + schemaList: []string{"execution_count_idx"}, + query: addIndexOnExecutionCountComputedColStmtStats, + schemaExistsFn: hasIndex, + }, + { + name: "create-service-latency-computed-col-stmt-stats", + schemaList: []string{"service_latency"}, + query: addServiceLatencyComputedColStmtStats, + schemaExistsFn: hasColumn, + }, + { + name: "create-service-latency-idx-stmt-stats", + schemaList: []string{"service_latency_idx"}, + query: addIndexOnServiceLatencyComputedColStmtStats, + schemaExistsFn: hasIndex, + }, + { + name: "create-cpu-sql-nanos-computed-col-stmt-stats", + schemaList: []string{"cpu_sql_nanos"}, + query: addCpuSqlNanosComputedColStmtStats, + schemaExistsFn: hasColumn, + }, + { + name: "create-cpu-sql-nanos-idx-stmt-stats", + schemaList: []string{"cpu_sql_nanos_idx"}, + query: addIndexOnCpuSqlNanosComputedColStmtStats, + schemaExistsFn: hasIndex, + }, + { + name: "create-contention-time-computed-col-stmt-stats", + schemaList: []string{"contention_time"}, + query: addContentionTimeComputedColStmtStats, + schemaExistsFn: hasColumn, + }, + { + name: "create-contention-time-idx-stmt-stats", + schemaList: []string{"contention_time_idx"}, + query: addIndexOnContentionTimeComputedColStmtStats, + schemaExistsFn: hasIndex, + }, + { + name: "create-total-estimated-execution-time-computed-col-stmt-stats", + schemaList: []string{"total_estimated_execution_time"}, + query: addTotalEstimatedExecutionTimeComputedColStmtStats, + schemaExistsFn: hasColumn, + }, + { + name: "create-total-estimated-execution-time-idx-stmt-stats", + schemaList: []string{"total_estimated_execution_time_idx"}, + query: addIndexOnTotalEstimatedExecutionTimeComputedColStmtStats, + schemaExistsFn: hasIndex, + }, + } { + if err := migrateTable(ctx, cs, d, op, keys.StatementStatisticsTableID, systemschema.StatementStatisticsTable); err != nil { + return err + } + } + + for _, op := range []operation{ + { + name: "create-execution-count-computed-col-txn-stats", + schemaList: []string{"execution_count"}, + query: addExecutionCountComputedColTxnStats, + schemaExistsFn: hasColumn, + }, + { + name: "create-execution-count-idx-txn-stats", + schemaList: []string{"execution_count_idx"}, + query: addIndexOnExecutionCountComputedColTxnStats, + schemaExistsFn: hasIndex, + }, + { + name: "create-service-latency-computed-col-txn-stats", + schemaList: []string{"service_latency"}, + query: addServiceLatencyComputedColTxnStats, + schemaExistsFn: hasColumn, + }, + { + name: "create-service-latency-idx-txn-stats", + schemaList: []string{"service_latency_idx"}, + query: addIndexOnServiceLatencyComputedColTxnStats, + schemaExistsFn: hasIndex, + }, + { + name: "create-cpu-sql-nanos-computed-col-txn-stats", + schemaList: []string{"cpu_sql_nanos"}, + query: addCpuSqlNanosComputedColTxnStats, + schemaExistsFn: hasColumn, + }, + { + name: "create-cpu-sql-nanos-idx-txn-stats", + schemaList: []string{"cpu_sql_nanos_idx"}, + query: addIndexOnCpuSqlNanosComputedColTxnStats, + schemaExistsFn: hasIndex, + }, + { + name: "create-contention-time-computed-col-txn-stats", + schemaList: []string{"contention_time"}, + query: addContentionTimeComputedColTxnStats, + schemaExistsFn: hasColumn, + }, + { + name: "create-contention-time-idx-txn-stats", + schemaList: []string{"contention_time_idx"}, + query: addIndexOnContentionTimeComputedColTxnStats, + schemaExistsFn: hasIndex, + }, + { + name: "create-total-estimated-execution-time-computed-col-txn-stats", + schemaList: []string{"total_estimated_execution_time"}, + query: addTotalEstimatedExecutionTimeComputedColTxnStats, + schemaExistsFn: hasColumn, + }, + { + name: "create-total-estimated-execution-time-idx-txn-stats", + schemaList: []string{"total_estimated_execution_time_idx"}, + query: addIndexOnTotalEstimatedExecutionTimeComputedColTxnStats, + schemaExistsFn: hasIndex, + }, + } { + if err := migrateTable(ctx, cs, d, op, keys.TransactionStatisticsTableID, + systemschema.TransactionStatisticsTable); err != nil { + return err + } + } + return nil +} diff --git a/pkg/upgrade/upgrades/create_computed_indexes_sql_statistics_test.go b/pkg/upgrade/upgrades/create_computed_indexes_sql_statistics_test.go new file mode 100644 index 000000000000..2009420c6cea --- /dev/null +++ b/pkg/upgrade/upgrades/create_computed_indexes_sql_statistics_test.go @@ -0,0 +1,99 @@ +// Copyright 2023 The Cockroach Authors. +// +// Use of this software is governed by the Business Source License +// included in the file licenses/BSL.txt. +// +// As of the Change Date specified in that file, in accordance with +// the Business Source License, use of this software will be governed +// by the Apache License, Version 2.0, included in the file +// licenses/APL.txt. + +package upgrades_test + +import ( + "context" + "testing" + + "github.com/cockroachdb/cockroach/pkg/base" + "github.com/cockroachdb/cockroach/pkg/clusterversion" + "github.com/cockroachdb/cockroach/pkg/keys" + "github.com/cockroachdb/cockroach/pkg/server" + "github.com/cockroachdb/cockroach/pkg/sql/catalog/systemschema" + "github.com/cockroachdb/cockroach/pkg/testutils/testcluster" + "github.com/cockroachdb/cockroach/pkg/upgrade/upgrades" + "github.com/cockroachdb/cockroach/pkg/util/leaktest" + "github.com/cockroachdb/cockroach/pkg/util/log" +) + +func TestCreateComputedIndexesOnSystemSQLStatistics(t *testing.T) { + defer leaktest.AfterTest(t)() + defer log.Scope(t).Close(t) + + clusterArgs := base.TestClusterArgs{ + ServerArgs: base.TestServerArgs{ + Knobs: base.TestingKnobs{ + Server: &server.TestingKnobs{ + DisableAutomaticVersionUpgrade: make(chan struct{}), + BinaryVersionOverride: clusterversion.ByKey( + clusterversion.V23_1AddSQLStatsComputedIndexes - 1), + }, + }, + }, + } + + var ( + ctx = context.Background() + + tc = testcluster.StartTestCluster(t, 1, clusterArgs) + s = tc.Server(0) + sqlDB = tc.ServerConn(0) + ) + defer tc.Stopper().Stop(ctx) + + var ( + validationSchemas = []upgrades.Schema{ + {Name: "execution_count", ValidationFn: upgrades.HasColumn}, + {Name: "execution_count_idx", ValidationFn: upgrades.HasIndex}, + {Name: "service_latency", ValidationFn: upgrades.HasColumn}, + {Name: "service_latency_idx", ValidationFn: upgrades.HasIndex}, + {Name: "cpu_sql_nanos", ValidationFn: upgrades.HasColumn}, + {Name: "cpu_sql_nanos_idx", ValidationFn: upgrades.HasIndex}, + {Name: "contention_time", ValidationFn: upgrades.HasColumn}, + {Name: "contention_time_idx", ValidationFn: upgrades.HasIndex}, + {Name: "total_estimated_execution_time", ValidationFn: upgrades.HasColumn}, + {Name: "total_estimated_execution_time_idx", ValidationFn: upgrades.HasIndex}, + } + ) + + // Run the upgrade. + upgrades.Upgrade( + t, + sqlDB, + clusterversion.V23_1AddSQLStatsComputedIndexes, + nil, /* done */ + false, /* expectError */ + ) + // Validate that the tables have new schemas. + upgrades.ValidateSchemaExists( + ctx, + t, + s, + sqlDB, + keys.StatementStatisticsTableID, + systemschema.StatementStatisticsTable, + []string{}, + validationSchemas, + true, /* expectExists */ + ) + upgrades.ValidateSchemaExists( + ctx, + t, + s, + sqlDB, + keys.TransactionStatisticsTableID, + systemschema.TransactionStatisticsTable, + []string{}, + validationSchemas, + true, /* expectExists */ + ) +} diff --git a/pkg/upgrade/upgrades/upgrades.go b/pkg/upgrade/upgrades/upgrades.go index 0f5128abbbfa..74a4f0c304ca 100644 --- a/pkg/upgrade/upgrades/upgrades.go +++ b/pkg/upgrade/upgrades/upgrades.go @@ -292,6 +292,12 @@ var upgrades = []upgradebase.Upgrade{ createAutoConfigRunnerJob, "create auto config runner job", ), + upgrade.NewTenantUpgrade( + "create and index new computed columns on system sql stats tables", + toCV(clusterversion.V23_1AddSQLStatsComputedIndexes), + upgrade.NoPrecondition, + createComputedIndexesOnSystemSQLStatistics, + ), } func init() { From 9f9c904eb2959be27cbd19d13f0af7f2ffef8f48 Mon Sep 17 00:00:00 2001 From: David Taylor Date: Mon, 13 Mar 2023 13:16:27 +0000 Subject: [PATCH 6/6] sql: unify physical planning Previously system tenants and secondary tenants used different physical planning implementations, with the system tenant and only the system tenant using nodeIDs while other tenants used the instance table. This unifies those implementations such that all tenants use NodeIDs if running in mixed mode and use the instance table if not. Release note: none. Epic: CRDB-16910 --- pkg/sql/distsql_physical_planner.go | 105 +++++++++++++++++----------- 1 file changed, 63 insertions(+), 42 deletions(-) diff --git a/pkg/sql/distsql_physical_planner.go b/pkg/sql/distsql_physical_planner.go index fa802478e871..3dab75fe8129 100644 --- a/pkg/sql/distsql_physical_planner.go +++ b/pkg/sql/distsql_physical_planner.go @@ -1154,13 +1154,13 @@ func (dsp *DistSQLPlanner) PartitionSpans( // If we're planning locally, map all spans to the gateway. return []SpanPartition{{dsp.gatewaySQLInstanceID, spans}}, nil } - if dsp.codec.ForSystemTenant() { - return dsp.partitionSpansSystem(ctx, planCtx, spans) + if dsp.useGossipPlanning(ctx, planCtx) { + return dsp.deprecatedPartitionSpansSystem(ctx, planCtx, spans) } - return dsp.partitionSpansTenant(ctx, planCtx, spans) + return dsp.partitionSpans(ctx, planCtx, spans) } -// partitionSpans takes a single span and splits it up according to the owning +// partitionSpan takes a single span and splits it up according to the owning // nodes (if the span touches multiple ranges). // // - partitions is the set of SpanPartitions so far. The updated set is @@ -1266,14 +1266,14 @@ func (dsp *DistSQLPlanner) partitionSpan( return partitions, lastPartitionIdx, nil } -// partitionSpansSystem finds node owners for ranges touching the given spans +// deprecatedPartitionSpansSystem finds node owners for ranges touching the given spans // for a system tenant. -func (dsp *DistSQLPlanner) partitionSpansSystem( +func (dsp *DistSQLPlanner) deprecatedPartitionSpansSystem( ctx context.Context, planCtx *PlanningCtx, spans roachpb.Spans, ) (partitions []SpanPartition, _ error) { nodeMap := make(map[base.SQLInstanceID]int) resolver := func(nodeID roachpb.NodeID) base.SQLInstanceID { - return dsp.getSQLInstanceIDForKVNodeIDSystem(ctx, planCtx, nodeID) + return dsp.deprecatedSQLInstanceIDForKVNodeIDSystem(ctx, planCtx, nodeID) } for _, span := range spans { var err error @@ -1287,14 +1287,16 @@ func (dsp *DistSQLPlanner) partitionSpansSystem( return partitions, nil } -// partitionSpansTenant assigns SQL instances in a tenant to spans. It performs -// region-aware physical planning among all available SQL instances if the -// region information is available on at least some of the instances, and it -// falls back to naive round-robin assignment if not. -func (dsp *DistSQLPlanner) partitionSpansTenant( +// partitionSpans assigns SQL instances to spans. In mixed sql and KV mode it +// generally assigns each span to the instance hosted on the KV node chosen by +// the configured replica oracle, while in clusters operating with standalone +// SQL instances it performs locality-aware physical planning among all +// available SQL instances if the locality info is available on at least some of +// the instances, and it falls back to naive round-robin assignment if not. +func (dsp *DistSQLPlanner) partitionSpans( ctx context.Context, planCtx *PlanningCtx, spans roachpb.Spans, ) (partitions []SpanPartition, _ error) { - resolver, instances, hasLocalitySet, err := dsp.makeSQLInstanceIDForKVNodeIDTenantResolver(ctx) + resolver, instances, err := dsp.makeInstanceResolver(ctx) if err != nil { return nil, err } @@ -1305,7 +1307,7 @@ func (dsp *DistSQLPlanner) partitionSpansTenant( // Rows with column families may have been split into different spans. // These spans should be assigned the same pod so that the pod can // stitch together the rows correctly. Split rows are in adjacent spans. - if safeKey, err := keys.EnsureSafeSplitKey(span.Key); err == nil { + if safeKey, err := keys.EnsureSafeSplitKey(span.Key); err == nil && len(safeKey) > 0 { if safeKey.Equal(lastKey) { if log.V(1) { log.Infof(ctx, "partitioning span %s", span) @@ -1323,17 +1325,17 @@ func (dsp *DistSQLPlanner) partitionSpansTenant( return nil, err } } - if err = dsp.maybeReassignToGatewaySQLInstance(partitions, instances, hasLocalitySet); err != nil { + if err = dsp.maybeReassignToGatewaySQLInstance(partitions, instances); err != nil { return nil, err } return partitions, nil } -// getSQLInstanceIDForKVNodeIDSystem returns the SQL instance ID that should +// deprecatedSQLInstanceIDForKVNodeIDSystem returns the SQL instance that should // handle the range with the given node ID when planning is done on behalf of // the system tenant. It ensures that the chosen SQL instance is healthy and of // the compatible DistSQL version. -func (dsp *DistSQLPlanner) getSQLInstanceIDForKVNodeIDSystem( +func (dsp *DistSQLPlanner) deprecatedSQLInstanceIDForKVNodeIDSystem( ctx context.Context, planCtx *PlanningCtx, nodeID roachpb.NodeID, ) base.SQLInstanceID { sqlInstanceID := base.SQLInstanceID(nodeID) @@ -1348,42 +1350,55 @@ func (dsp *DistSQLPlanner) getSQLInstanceIDForKVNodeIDSystem( return sqlInstanceID } -// makeSQLInstanceIDForKVNodeIDTenantResolver returns a function that can choose -// the SQL instance ID for a provided node ID on behalf of a tenant. It also -// returns a list of all healthy instances for the current tenant as well as a -// boolean indicating whether the locality information is available for at least -// some of those instances. -func (dsp *DistSQLPlanner) makeSQLInstanceIDForKVNodeIDTenantResolver( +// instanceIDForKVNodeHostedInstance returns the SQL instance ID for an +// instance that is hosted in the process of a KV node. Currently SQL +// instances run in KV node processes have IDs fixed to be equal to the KV +// nodes' IDs, and all of the SQL instances for a given tenant are _either_ +// run in this mixed mode or standalone, meaning if this server is in mixed +// mode, we can safely assume every other server is as well, and thus has +// IDs matching node IDs. +func instanceIDForKVNodeHostedInstance(nodeID roachpb.NodeID) base.SQLInstanceID { + return base.SQLInstanceID(nodeID) +} + +// makeInstanceResolver returns a function that can choose the SQL instance ID +// for a provided KV node ID. It also returns a list of all healthy instances if +// that list was used in choosing an instance, specifically if the localities of +// those instances were used to decide the assignment, for use by any steps that +// wish to post-process that assignment (such as adjusting based on localities). +// If the instance was assigned statically or the instance list had no locality +// information leading to random assignments then no instance list is returned. +func (dsp *DistSQLPlanner) makeInstanceResolver( ctx context.Context, -) ( - resolver func(roachpb.NodeID) base.SQLInstanceID, - _ []sqlinstance.InstanceInfo, - hasLocalitySet bool, - _ error, -) { +) (func(roachpb.NodeID) base.SQLInstanceID, []sqlinstance.InstanceInfo, error) { + if _, mixedProcessMode := dsp.distSQLSrv.NodeID.OptionalNodeID(); mixedProcessMode { + return instanceIDForKVNodeHostedInstance, nil, nil + } + // GetAllInstances only returns healthy instances. // TODO(yuzefovich): confirm that all instances are of compatible version. instances, err := dsp.sqlAddressResolver.GetAllInstances(ctx) if err != nil { - return nil, nil, false, err + return nil, nil, err } if len(instances) == 0 { - return nil, nil, false, errors.New("no healthy sql instances available for planning") + return nil, nil, errors.New("no healthy sql instances available for planning") } rng, _ := randutil.NewPseudoRand() + instancesHaveLocality := false for i := range instances { if instances[i].Locality.NonEmpty() { - hasLocalitySet = true + instancesHaveLocality = true break } } // If we were able to determine the locality information for at least some // instances, use the region-aware resolver. - if hasLocalitySet { - resolver = func(nodeID roachpb.NodeID) base.SQLInstanceID { + if instancesHaveLocality { + resolver := func(nodeID roachpb.NodeID) base.SQLInstanceID { // Lookup the node localities to compare to the instance localities. nodeDesc, err := dsp.nodeDescs.GetNodeDescriptor(nodeID) if err != nil { @@ -1398,7 +1413,7 @@ func (dsp *DistSQLPlanner) makeSQLInstanceIDForKVNodeIDTenantResolver( // just return the gateway. return dsp.gatewaySQLInstanceID } - return resolver, instances, hasLocalitySet, nil + return resolver, instances, nil } // If no sql instances have locality information, fallback to a naive @@ -1409,12 +1424,12 @@ func (dsp *DistSQLPlanner) makeSQLInstanceIDForKVNodeIDTenantResolver( instances[i], instances[j] = instances[j], instances[i] }) var i int - resolver = func(roachpb.NodeID) base.SQLInstanceID { + resolver := func(roachpb.NodeID) base.SQLInstanceID { id := instances[i%len(instances)].InstanceID i++ return id } - return resolver, instances, false, nil + return resolver, nil, nil } // closestInstances returns the subset of instances which are closest to the @@ -1445,7 +1460,7 @@ func closestInstances( // the locality information isn't available for the instances, then we assume // the assigned instance to be in the same region as the gateway. func (dsp *DistSQLPlanner) maybeReassignToGatewaySQLInstance( - partitions []SpanPartition, instances []sqlinstance.InstanceInfo, hasLocalitySet bool, + partitions []SpanPartition, instances []sqlinstance.InstanceInfo, ) error { if len(partitions) != 1 || partitions[0].SQLInstanceID == dsp.gatewaySQLInstanceID { // Keep the existing partitioning if more than one instance is used or @@ -1453,7 +1468,7 @@ func (dsp *DistSQLPlanner) maybeReassignToGatewaySQLInstance( return nil } var gatewayRegion, assignedRegion string - if hasLocalitySet { + if len(instances) > 0 { assignedInstance := partitions[0].SQLInstanceID var ok bool for _, instance := range instances { @@ -1480,6 +1495,7 @@ func (dsp *DistSQLPlanner) maybeReassignToGatewaySQLInstance( } } } + if gatewayRegion == assignedRegion { partitions[0].SQLInstanceID = dsp.gatewaySQLInstanceID } @@ -1512,16 +1528,21 @@ func (dsp *DistSQLPlanner) getInstanceIDForScan( return 0, err } - if dsp.codec.ForSystemTenant() { - return dsp.getSQLInstanceIDForKVNodeIDSystem(ctx, planCtx, replDesc.NodeID), nil + if dsp.useGossipPlanning(ctx, planCtx) { + return dsp.deprecatedSQLInstanceIDForKVNodeIDSystem(ctx, planCtx, replDesc.NodeID), nil } - resolver, _, _, err := dsp.makeSQLInstanceIDForKVNodeIDTenantResolver(ctx) + resolver, _, err := dsp.makeInstanceResolver(ctx) if err != nil { return 0, err } return resolver(replDesc.NodeID), nil } +func (dsp *DistSQLPlanner) useGossipPlanning(ctx context.Context, _ *PlanningCtx) bool { + // TODO(dt): enable this by default, e.g. // && !dsp.distSQLSrv.Settings.Version.IsActive(ctx, clusterversion.V23_1) + return dsp.codec.ForSystemTenant() +} + // convertOrdering maps the columns in props.ordering to the output columns of a // processor. func (dsp *DistSQLPlanner) convertOrdering(