Help Center/ MapReduce Service/ Troubleshooting/ Using ClickHouse/ Error Message "Max query size exceeded" Is Displayed During ClickHouse Query
Updated on 2025-12-01 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 (bytes) of a ClickHouse SQL statement that can be loaded by the ClickHouse SQL parser to the RAM for parsing. The default value is 262144, that is, 256 KB.

Solution

  1. Set the value of max_query_size to no greater than 256 KB, because the query performance will be undermined 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 for the ClickHouseServer role instance on Manager.