Clickhouse query timeout not respected

  • Goal: query a large clickhouse table

  • Steps:

  1. connect to clickhouse table
  2. create query
  3. incrase timeout in advanced to 100k ms
  4. see that timeout still happens after 30sec
  • Details:
    when I try to submit a large query to clickhouse that needs more than 30 seconds, retool automatically times out after 30seconds. It seems that the timeout field in the advan

  • Screenshots:
    Heres a screenshot showing 100k msec timeout

Here's the query timing out after 30seconds

For what it's worth, the default timeout in the nodejs library is 30 seconds: clickhouse-js/packages/client-common/src/config.ts at main ยท ClickHouse/clickhouse-js ยท GitHub

1 Like

HI @paymahn,

Here are a couple ideas:

  1. Manually Set max_execution_time in the Query. Even though the Node.js default is 30s, ClickHouse allows you to override it per query. Try adding this setting directly to your query:
    SELECT * FROM large_table SETTINGS max_execution_time = 120;

  2. Increase Timeout at the ClickHouse Client Level
    If Retool allows setting the ClickHouse connection options, update the Node.js ClickHouse client configuration with:

const clickhouse = new ClickHouse({
  url: 'http://your-clickhouse-server',
  timeout: 120000 // Increase timeout to 120 seconds
});
1 Like

neat idea setting the execution time directly in the query, will definitely try that.

Unfortunatley I can't change how the clickhouse client is initialized by retool since I'm using the builtin clickhouse connector.

2 Likes