Karl R
10/01/2026, 8:23 PMRocky
10/01/2026, 8:23 PMcolocate_with property when creating an asynchronous materialized view. This ensures that the data distribution (bucketing and replica placement) of the materialized view matches other tables or materialized views in the same group, enabling Colocate Joins for better performance.
Usage
To assign a materialized view to a colocation group, include the colocate_with property in the PROPERTIES clause:
sql
CREATE MATERIALIZED VIEW mv_example
DISTRIBUTED BY HASH(k1) BUCKETS 8
PROPERTIES (
"colocate_with" = "group_name"
)
AS
SELECT k1, SUM(v1) FROM base_table GROUP BY k1;
Key Considerations
* Requirements: For a materialized view to join a colocation group, it must have the same distribution key types, order, and number of buckets as the other members of the group.
* Modifying Existing MVs: You can also add or change the colocation group of an existing materialized view using the ALTER statement:
sql
ALTER MATERIALIZED VIEW mv_example SET ("colocate_with" = "new_group_name");
* Synchronous Materialized Views (Rollups): These are technically special indexes attached to a base table. They automatically follow the distribution of the base table. Since v3.2.0, the FE configuration enable_colocate_mv_index (enabled by default) ensures that these indexes are colocated with the base table data for faster writes.
References
• using_starrocks/Colocate_join.md
• using_starrocks/Materialized_view-single_table.md
• administration/management/FE_configuration.md
• best_practices/audit_log_resource_group.md
• knowledge/usage/best-practice.md
• using_starrocks/async_mv/feature-support-asynchronous-materialized-views.md