0
votes

In my work, fact tables are stored in ClickHouse, dimension tables are stored in MySQL database, So MySQL database engine is used to connect ClickHouse and MySQL database. From ClickHouse SQL running log, I can find that ClickHouse will fetch data needed from MySQL database and do aggregate. My Question is what mode ClickHouse get data from MySQL database? is right ClickHouse get all data needed in query and then do aggregation or do these two actions concurrently? How can I improve SQL performance used in this scene? Is there any practice skills?

1

1 Answers

0
votes

External dictionaries loads data (from Mysql i.e.) and caches this data in CH server memory. External dictionaries (dictGet) faster than SELECTs from Engine Mysql on indefinite number times.

https://clickhouse.tech/docs/en/sql-reference/dictionaries/external-dictionaries/external-dicts/#dicts-external-dicts

https://clickhouse.tech/docs/en/sql-reference/statements/create/dictionary/