Help Center/ MapReduce Service/ Troubleshooting/ Using ClickHouse/ Error Message "Max query size exceeded" Is Displayed During ClickHouse Query
Updated on 2025-08-19 GMT+08:00

Error Message "Max query size exceeded" Is Displayed During ClickHouse Query

Symptom

When a query statement is executed in ClickHouse, the error message "Max query size exceeded" is displayed.

Cause Analysis

The max_query_size parameter specifies the maximum size of a ClickHouse SQL statement that can be loaded by the ClickHouse SQL parser to the RAM for parsing. The unit is byte. The default value is 262144, that is, 256 KB.

Solution

  1. Limit the size of a SQL statement not to exceed 256 KB, because the query performance will be influenced if SQL statements are complex. You can optimize the SQL statements based on your services.
  2. Change the value of profiles.default.max_query_size of the ClickHouseServer role instance on Manager.