diff --git a/docs/generated/settings/settings-for-tenants.txt b/docs/generated/settings/settings-for-tenants.txt index 92ee39b14b8d..690c76f8063e 100644 --- a/docs/generated/settings/settings-for-tenants.txt +++ b/docs/generated/settings/settings-for-tenants.txt @@ -239,6 +239,7 @@ sql.metrics.max_mem_stmt_fingerprints integer 100000 the maximum number of state sql.metrics.max_mem_txn_fingerprints integer 100000 the maximum number of transaction fingerprints stored in memory sql.metrics.statement_details.dump_to_logs boolean false dump collected statement statistics to node logs when periodically cleared sql.metrics.statement_details.enabled boolean true collect per-statement query statistics +sql.metrics.statement_details.index_recommendation_collection.enabled boolean true generate an index recommendation for each fingerprint ID sql.metrics.statement_details.plan_collection.enabled boolean true periodically save a logical plan for each fingerprint sql.metrics.statement_details.plan_collection.period duration 5m0s the time until a new logical plan is collected sql.metrics.statement_details.threshold duration 0s minimum execution time to cause statement statistics to be collected. If configured, no transaction stats are collected. diff --git a/docs/generated/settings/settings.html b/docs/generated/settings/settings.html index fd9090229b83..32142336f566 100644 --- a/docs/generated/settings/settings.html +++ b/docs/generated/settings/settings.html @@ -170,6 +170,7 @@ sql.metrics.max_mem_txn_fingerprintsinteger100000the maximum number of transaction fingerprints stored in memory sql.metrics.statement_details.dump_to_logsbooleanfalsedump collected statement statistics to node logs when periodically cleared sql.metrics.statement_details.enabledbooleantruecollect per-statement query statistics +sql.metrics.statement_details.index_recommendation_collection.enabledbooleantruegenerate an index recommendation for each fingerprint ID sql.metrics.statement_details.plan_collection.enabledbooleantrueperiodically save a logical plan for each fingerprint sql.metrics.statement_details.plan_collection.periodduration5m0sthe time until a new logical plan is collected sql.metrics.statement_details.thresholdduration0sminimum execution time to cause statement statistics to be collected. If configured, no transaction stats are collected. diff --git a/pkg/sql/sqlstats/cluster_settings.go b/pkg/sql/sqlstats/cluster_settings.go index c254a52e02ae..dd487311c074 100644 --- a/pkg/sql/sqlstats/cluster_settings.go +++ b/pkg/sql/sqlstats/cluster_settings.go @@ -159,3 +159,12 @@ var MaxSQLStatReset = settings.RegisterDurationSetting( time.Hour*2, settings.NonNegativeDurationWithMaximum(time.Hour*24), ).WithPublic() + +// SampleIndexRecommendation specifies whether we generate an index recommendation +// for each fingerprint ID. +var SampleIndexRecommendation = settings.RegisterBoolSetting( + settings.TenantWritable, + "sql.metrics.statement_details.index_recommendation_collection.enabled", + "generate an index recommendation for each fingerprint ID", + true, +).WithPublic()