Resolve issues with DoubleCloud Managed ClickHouse®
On a rare occasion, your Managed ClickHouse® cluster may not work as expected. Our experience shows that you can fix a significant portion of these cases without a need to contact technical support.
This article covers the following topics:
- Copy an existing Managed ClickHouse® cluster
- Change the maximum query size for a ClickHouse® cluster
- Change the maximum number of result rows
Copy an existing Managed ClickHouse® cluster
To copy your existing ClickHouse® cluster, you can use Transfer or export to CSV.
-
Replicate the data with Transfer.
-
Export the tables you need to a CSV file using with the following query in the ClickHouse® client:
<native_interface_connection_string> \ --query="SELECT * from <database_name>.<table_name>" > <file_name>.csv
Change the maximum query size for a ClickHouse® cluster
You can configure the max query size for your cluster using the ClickHouse® client:
-
Go to the Clusters
-
Select the cluster where you want to change the maximum query size.
-
On the cluster's information page, find the Native interface connection string and click Copy.
-
Paste the connection string into the terminal, but don’t run it yet.
-
To the end of your connection string, add the following:
--max_query_size=<size>
Replace
<size>
with the desired query size in bytes, such as65536
. -
Run the command
Tip
To change the maximum query size in a session that's already running, use the following statement:
SET max_query_size = <size>
Replace <size>
with the desired query size in bytes, such as 65536
.
To permanently change the maximum query size for a single user, run the following statement connecting to your cluster in the ClickHouse® client:
ALTER USER <username> SETTINGS max_query_size = <size>
Replace <size>
with the desired query size in bytes, such as 65536
.
To set the maximum query size for multiple users, consider creating a settings profile with the following statement:
CREATE SETTINGS PROFILE <profile_name> SETTINGS max_query_size = <size> TO <users>
Replace the following:
-
<profile_name>
: name of the settings profile, such asmax_query_size_profile
. -
<size>
: the desired query size in bytes, such as65536
. -
<users>
: list of users you want to apply the settings profile to.
Change the maximum number of result rows
You may want to change the maximum number of result rows if a query result doesn't contain all the data.
-
Go to the Clusters
-
Select the cluster where you want to change the maximum number of rows.
-
On the cluster's information page, find the Native interface connection string and click Copy.
-
Paste the connection string into the terminal, but don’t run it yet.
-
To the end of your connection string, add the following:
--max_result_rows=<rows>
Replace
<rows>
with the maximum number of rows you want to get, such as32768
. -
Run the command.
To permanently change the max number of result rows a single user, run the following statement after connecting to your cluster in the ClickHouse® client:
SET max_result_rows = <rows>
Replace <rows>
with the maximum number of rows you want to get, such as 32768
.