This topic describes how to modify the global parameters in the user.xml file of an ApsaraDB for ClickHouse cluster.

Background information

An ApsaraDB for ClickHouse cluster has a number of global parameters. The default values of these parameters are defined in the config.xml and user.xml files. You can optimize the performance of an ApsaraDB for ClickHouse cluster by modifying the global parameters in these configuration files.

  • You can modify the parameters in the config.xml file in the ApsaraDB for ClickHouse console. The modifications take effect only after you restart the cluster. For more information, see Modify parameters in config.xml.
  • You can modify the parameters in the user.xml file by running set global statements. The modifications take effect immediately and you do not need to restart the cluster.

Syntax

The syntax of set global statements is set global on cluster default key = value;. If the value is a Boolean value or a string, enclose the value in single quotation marks ('). Examples:

set global on cluster default max_block_size=10000;
set global on cluster default totals_mode='any';
set global on cluster default input_format_parallel_parsing='True';
Note For more information about the global parameters that are supported by ApsaraDB for ClickHouse, see the Settings topic of the open source ClickHouse documentation.

Procedure

  • Modify the parameters by using a client tool

    Connect to your ApsaraDB for ClickHouse cluster by using a client tool such as DBeaver. Then, execute set global statements in the same way as you execute regular data definition language (DDL) statements.

  • Modify the parameters by using a Java Database Connectivity (JDBC) connection

    Write Java code to establish a JDBC connection to your ApsaraDB for ClickHouse cluster. Then, execute set global statements to modify the parameters.