Hello, I have a question about the granularity of ...
# questions-and-troubleshooting
u
Hello, I have a question about the granularity of a MATERIALIZED VIEW refresh.
Copy code
CREATE MATERIALIZED VIEW `mv_name` (~~~~)
COMMENT "MATERIALIZED_VIEW"
PARTITION BY (`date`)
DISTRIBUTED BY HASH(`key`) BUCKETS 20

ORDER BY (~~~)
REFRESH ASYNC
PROPERTIES (
...
)
AS select * from base_table
In the above statement, data is being inserted into base_table in real time. So, I understand that updates are performed on a partition-by-partition basis. Is the partition updated every time data is inserted? Or is the partition updated for a specific chunk?
a
The refresh interval can be controlled. If it’s synchronous, it will be refreshed immediately. If it’s asynchronous, it will be refreshed at interval.
u
I'm using asynchronous mv and I didn't use interval.
However, data continues to be updated on a partition-by-partition basis.
a
If data changes and no interval, it will reflect in the materialized view.
u
Does that mean that the data is refreshed every time it changes? So, if the table that serves as the source for mv has frequent data insertions, the refresh may be delayed?
a
It the source has very frequent data insertions, you need to think carefully about the refresh cost.