Reputation: 395
the problem is like that - there is a table with records like:
time, value
2020-04-01T10:00:00, 23
2020-04-01T10:00:01, 22
2020-04-01T10:00:02, 24
In Clickhouse database.
Then a script is called with some part of this data, for example with records ranging from 2020-05-01T10:00:00
to 20-06-01T10:00:00
.
This time-aware data could be changed over time, but the original data script was called with is need to be known. This could be solved with copying all the data the script was called with and storing it somewhere else, but this won't be memory efficient.
So, is there something, which would like 'reference mirror' it in something like 'Clickhouse view' without fully replicating it? Only the changed data in original table should be copied fully in an original form. So after this, when I reference that mirror view I get original data the script was called with. Is it possible in Clickhouse? How would you approach this?
Upvotes: 0
Views: 305
Reputation: 13310
Only the changed data in original table should be copied fully
There is no way to do it. CH design does not allow on the fly to find out that rows with the same key already exists.
How would you approach this?
I would store all history in one table and the last state in another.
Upvotes: 1