Skip to main content
The SET CLUSTER SETTING modifies a .
Many cluster settings are intended for tuning CockroachDB internals. Before changing these settings, we strongly encourage you to discuss your goals with CockroachDB; otherwise, you use them at your own risk.

Required privileges

To use the SET CLUSTER SETTING statement, a user must have one of the following attributes:
  • Be a member of the admin role. (By default, the root user belongs to the admin role.)
  • Have the MODIFYCLUSTERSETTING granted. root and users have this system-level privilege by default and are capable of granting it to other users and roles using the statement. For example to grant this system-level privilege to user maxroach:
  • Have the MODIFYSQLCLUSTERSETTING granted. Users with this privilege are allowed to modify only , not all cluster settings.

Synopsis

set_cluster_setting syntax diagram
The SET CLUSTER SETTING statement is unrelated to the other and statements.

Parameters

ParameterDescription
var\_nameThe name of the (case-insensitive).
var\_valueThe value for the .
DEFAULTReset the to its default value. The {” ”} resets a cluster setting as well.

Examples

Change the default distributed execution parameter

To configure a cluster so that new sessions automatically try to run queries in a distributed fashion:
To disable distributed execution for all new sessions:
Use instead of the sql.defaults.* . This allows you to set a default value for all users for any that applies during login, making the sql.defaults.* cluster settings redundant.

Disable automatic diagnostic reporting

To opt out of of usage data to Cockroach Labs:

Reset a setting to its default value

You can use to reset a cluster setting as well.

See also