Search CTRL + K

ClickHouse Drop Cache

ClickHouse 缓存主要有 [1]

还有一些非重要缓存,比如:

清空缓存

针对主要缓存可以这样清空:

其他非重要缓存的清空参考官方文档 [4]

DROP DNS CACHE;
DROP UNCOMPRESSED CACHE;
DROP COMPILED EXPRESSION CACHE;
DROP QUERY CACHE;
DROP FORMAT SCHEMA CACHE;
DROP FILESYSTEM CACHE [ON CLUSTER cluster_name];

ClickHouse Cache Types

Main cache types:

  • mark_cache — Cache of marks used by table engines of the MergeTree family.
  • uncompressed_cache — Cache of uncompressed data used by table engines of the MergeTree family.
  • Operating system page cache (used indirectly, for files with actual data).

Additional cache types:

  • DNS cache.
  • Regexp cache.
  • Compiled expressions cache.
  • Avro format schemas cache.
  • Dictionaries data cache.
  • Schema inference cache.
  • Filesystem cache over S3, Azure, Local and other disks.
  • Query cache.

[5]


  1. https://presentations.clickhouse.com/meetup60/overview-of-caching.pdf ↩︎

  2. https://clickhouse.com/docs/en/operations/settings/settings#setting-use_uncompressed_cache ↩︎

  3. https://clickhouse.com/docs/en/operations/settings/settings#min_bytes_to_use_direct_io ↩︎

  4. https://clickhouse.com/docs/en/sql-reference/statements/system ↩︎

  5. https://clickhouse.com/docs/en/operations/caches ↩︎