4

Is there any "without cache" option in clickhouse select query?

I want to check run-time performance of clickhouse without cache.

I expect options like SQL_NO_CACHE in mysql.

SELECT SQL_NO_CACHE * FROM table WHERE search= 'keyword';
hyeon
  • 373
  • 2
  • 4
  • 16
  • what goal you try achieve when "not use cache"? decrease memory usage? more precise for measurement of query performance? – Slach Nov 02 '19 at 04:51
  • @Slach Yes, it's for precise measurement of query performance – hyeon Nov 04 '19 at 01:51
  • @hyeon in this case vladimir right, just use https://clickhouse.yandex/docs/en/operations/settings/settings/#setting-use_uncompressed_cache and https://clickhouse.yandex/docs/en/operations/server_settings/settings/#server-settings-uncompressed_cache_size – Slach Nov 05 '19 at 08:38
  • @Slach Thank you – hyeon Nov 07 '19 at 04:47

2 Answers2

5

The cache reset is done in two steps:

  1. reset the OS PageCache
sync; echo 1 > /proc/sys/vm/drop_caches
  1. reset mark-cache in CH using DROP MARK CACHE
SYSTEM DROP MARK CACHE
vladimir
  • 13,428
  • 2
  • 44
  • 70
0

I think echo 1 > /proc/sys/vm/drop_caches is not a good idea. As when ck starts, the primary key is cached in memory so you can use settings min_bytes_to_use_direct_io=1