You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Allow inserting data into a materialized view that is being populated #2901
For creating materialized views, there's a great option to add POPULATE clause to it to fill new view with data that were inserted to the table before the view was created.
However, the docs states:
We don't recommend using POPULATE, since data inserted in the table during the view creation will not be inserted in it.
It would be very helpful if it was possible to POPULATE view and also have data, that are inserted to the table while populating the view, inserted to the view as well.
Reacted by Teun Hoogendoorn, Chris Baynes, Mykola Sonych and CARBONNEAUX Mathieu
when origin table are enormous, populate can be very long and can fail...
can be usefull to populate by range of data to avoid fail...
will be usefull to more secure the populate option to be abel to trottle the populate even if the populate will be more long....
or add the ability to insert into the materialized view...
As I learnt some time ago, materialized view is just a little unfortunately chosen name for insert trigger. Inserting into view is just inserting into it's inner table.
If you need to populate by range, I guess it would be better to use INSERT AS SELECT. But personally. I'd not use POPULATE anymore just because it seems easier to me to use few selects, inserts and deletes, tweaked to the current use case.
Activity
mcarbonneaux commentedon Apr 1, 2019
when origin table are enormous, populate can be very long and can fail...
can be usefull to populate by range of data to avoid fail...
will be usefull to more secure the populate option to be abel to trottle the populate even if the populate will be more long....
or add the ability to insert into the materialized view...
simPod commentedon Apr 1, 2019
As I learnt some time ago, materialized view is just a little unfortunately chosen name for insert trigger. Inserting into view is just inserting into it's inner table.
If you need to populate by range, I guess it would be better to use INSERT AS SELECT. But personally. I'd not use POPULATE anymore just because it seems easier to me to use few selects, inserts and deletes, tweaked to the current use case.
Merge pull request ClickHouse#2901 from Altinity/backports/antalya-26…