I'm completely new with Clickhouse, and I think I'm asking a very stupid question here but the document is very limited. I'm playing with MaterializedView, and my questions is this: if I create an new MV that joins 2 tables, how do I make sure the view is populated with the current data (not just new data that is inserted after the view is created)?

1 Answers

0
Ivan Blinkov On

Quote from official documentation:

If you specify POPULATE, the existing table data is inserted in the view when creating it, as if making a CREATE TABLE ... AS SELECT ... . Otherwise, the query contains only the data inserted in the table after creating the view. We don't recommend using POPULATE, since data inserted in the table during the view creation will not be inserted in it.

Also keep in mind that materialized views in ClickHouse work like a trigger for inserts to one table (left), which might work not as you expected in case of JOIN.