ClickHouse configuration

Configuring ClickHouse

If you don't know about config.xml and users.xml files yet, see How to configure ClickHouse?open in new window.

Server timezone

You can avoid a lot of confusion by configuringopen in new window ClickHouse to use UTC timezoneopen in new window by changing config.xml:

<?xml version="1.0" ?>
<clickhouse>
  <timezone>UTC</timezone>
</clickhouse>

Compression

By default, ClickHouse uses LZ4 to compress data, but you can get a better compression ratio by using ZSTD. To use ZSTD-3, change ClickHouse config.xml:

<?xml version="1.0" ?>
<clickhouse>
  <compression incl="clickhouse_compression">
    <case>
      <min_part_size>104857600</min_part_size>
      <min_part_size_ratio>0.01</min_part_size_ratio>
      <method>zstd</method>
      <level>3</level>
    </case>
  </compression>
</clickhouse>

prefer_column_name_to_alias

If you want to play with the queries generated by Uptrace, you should enable prefer_column_name_to_aliasopen in new window setting in ClickHouse users.xml:

<?xml version="1.0" ?>
<clickhouse>
  <profiles>
    <default>
      <prefer_column_name_to_alias>1</prefer_column_name_to_alias>
    </default>
  </profiles>
</clickhouse>
Last Updated: