0

In my limited experience with ClickHouse,I need analysis table's indexes and partitions is there any way to get clickhouse's queries of using what index and what partition? Thanks in advance.

bill
  • 5
  • 3

1 Answers1

1

With console client you can use set send_logs_level='debug';. After this for every query you will see info about query execution pipeline. This is very helpful for analysing partitions, index, memory and filters efficiency. Example log for query:

2021.03.30 16:17:13.716531 [ 3784 ] {db566a26-e6a8-4a15-ac48-f7b8e2d09652} <Debug>  (SelectExecutor): Selected 1607 parts by date, 1607 parts by key, 2265893 marks by primary key, 2265893 marks to read from 1607 ranges

Shows that query will read from 1607 parts.

If you need info to compare different variants of queries/table structures - look at query_log, it has lots of information that can be compared more precisely than query exec time.

ice
  • 777
  • 1
  • 4
  • 19