Home / Companies / ClickHouse / Blog / Post Details
Content Deep Dive

A simple guide to ClickHouse query optimization: part 1

Blog post from ClickHouse

Post Details
Company
Date Published
Author
Lionel Palacin
Word Count
4,506
Language
English
Hacker News Points
-
Summary

The author, who works on the product marketing engineering team at ClickHouse, shares their experience with optimizing query performance using the database's built-in tools and data schema changes. They start by identifying slow queries using query logs and then use tools like EXPLAIN indexes = 1 to analyze query execution plans. The author discusses various optimization techniques, including disabling the filesystem cache, reducing nullable columns, making best use of LowCardinality data type, optimizing data types, and choosing primary keys that filter in most queries. By applying these optimizations, they demonstrate significant improvements in query performance, with some changes resulting in a 34% reduction in disk space for one table. The author concludes by emphasizing the importance of understanding how ClickHouse works and utilizing its features to unlock full performance potential.