Aleksandr Zakharchenko
06/08/2026, 4:38 PMRocky
06/08/2026, 4:38 PMINCREMENTAL refresh mode combined with a high-frequency ASYNC refresh interval.
Starting with StarRocks v3.3 and refined in v4.x, the INCREMENTAL mode (Incremental View Maintenance) allows StarRocks to scan only the new data (deltas) in the Iceberg table since the last snapshot, rather than recomputing entire partitions.
SQL Example
sql
CREATE MATERIALIZED VIEW iceberg_incremental_mv
-- 1. Partition the MV to match the base table for efficiency
PARTITION BY (dt)
DISTRIBUTED BY HASH(user_id)
-- 2. Set the refresh interval to 1 minute for near real-time updates
REFRESH ASYNC EVERY (INTERVAL 1 MINUTE)
PROPERTIES (
-- 3. Use INCREMENTAL mode to process only deltas (Iceberg snapshots)
"refresh_mode" = "INCREMENTAL"
)
AS
SELECT
user_id,
dt,
count(event_id) as event_count,
sum(amount) as total_amount
FROM iceberg_catalog.sales_db.orders
GROUP BY user_id, dt;
Key Components for "Near Real-Time" Performance
1. refresh_mode = INCREMENTAL: This is the most critical property. Instead of performing a "Partition-level refresh" (which re-scans entire partitions where data changed), StarRocks uses Iceberg's snapshot metadata to identify and process only the newly appended rows.
2. REFRESH ASYNC EVERY (INTERVAL 1 MINUTE): This is the shortest recommended interval for asynchronous refreshes. It ensures the MV task is triggered frequently.
3. Partition Alignment: If the base Iceberg table is partitioned (e.g., by dt), partitioning the Materialized View by the same column allows StarRocks to manage data more efficiently and support partition-level TTL if needed.
4. Append-Only Requirement: The INCREMENTAL refresh mode currently supports append-only operations on the base Iceberg table. If the source table undergoes UPDATE, DELETE, or OVERWRITE operations:
* The refresh will fail if refresh_mode is set to INCREMENTAL.
* The system will fall back to a full/partition-level refresh if refresh_mode is set to AUTO.
How to Check Refresh Status
You can monitor if the MV is truly refreshing incrementally by checking the information_schema.task_runs table:
sql
SELECT
task_name,
create_time,
finish_time,
state,
get_json_string(extra_message, '$.refreshMode') as refresh_mode
FROM information_schema.task_runs
ORDER BY create_time DESC LIMIT 5;
Important Considerations
* Iceberg Version: Incremental detection is most robust for Iceberg V1 tables. For Iceberg V2 tables with equality/position deletes, ensure you are on StarRocks v3.3+ where support for these formats is being actively expanded.
* Operator Support: Incremental refresh supports standard operators like SELECT, FILTER, INNER JOIN, and AGGREGATE (with GROUP BY). It does not yet support DISTINCT or OUTER JOIN in true incremental mode.
References
• sql-reference/sql-statements/materialized_view/CREATE_MATERIALIZED_VIEW.md
• using_starrocks/async_mv/use_cases/data_lake_query_acceleration_with_materialized_views.mdAleksandr Zakharchenko
06/08/2026, 4:53 PMRocky
06/08/2026, 4:53 PMfe.conf and `cn.conf`:
* run_mode = shared_data
* Object storage credentials (S3 endpoint, bucket, access keys).
3. StarRocksCluster YAML Example
Below is an example manifest for the StarRocks Operator. This assumes you are using S3-compatible storage (like AWS S3 or MinIO).
yaml
apiVersion: <http://starrocks.com/v17|starrocks.com/v17> # Check your operator version for the correct API
kind: StarRocksCluster
metadata:
name: starrocks-shared-data
namespace: starrocks
spec:
starRocksFeSpec:
replicas: 3 # Recommended over 4 for quorum efficiency
image: starrocks/fe-ubuntu:4.1.1
configMapInfo:
configMapName: fe-config
resolveKey: fe.conf
storageVolumes:
- name: fe-meta
storageClassName: standard
storageSize: 10Gi
mountPath: /opt/starrocks/fe/meta
starRocksCnSpec:
replicas: 3
image: starrocks/cn-ubuntu:4.1.1
configMapInfo:
configMapName: cn-config
resolveKey: cn.conf
storageVolumes:
- name: cn-cache
storageClassName: local-path # High-performance SSD recommended for cache
storageSize: 100Gi
mountPath: /opt/starrocks/cn/storage
4. ConfigMap Details
You must create the ConfigMaps referenced above before applying the cluster manifest.
FE Config (fe.conf):
properties
run_mode = shared_data
cloud_native_storage_type = S3
aws_s3_path = my-bucket/starrocks_metadata
aws_s3_endpoint = <http://s3.us-east-1.amazonaws.com|s3.us-east-1.amazonaws.com>
aws_s3_region = us-east-1
aws_s3_access_key = <YOUR_ACCESS_KEY>
aws_s3_secret_key = <YOUR_SECRET_KEY>
# Enable storage volume access check
enable_storage_volume_access_check = true
CN Config (cn.conf):
properties
# CN is shared_data by default, but explicitly setting it is safer
sys_log_level = INFO
# Ensure the cache path matches your storageVolume mountPath
storage_root_path = /opt/starrocks/cn/storage
5. Deployment Steps
1. Install Operator: Ensure the StarRocks Operator is installed in your K8s cluster.
2. Create Secrets/ConfigMaps: Apply the fe-config and cn-config ConfigMaps containing your S3 credentials.
3. Apply Cluster: Run kubectl apply -f starrocks-cluster.yaml.
4. Verify:
* Check pods: kubectl get pods -n starrocks
* Check nodes in MySQL: SHOW FRONTENDS; and SHOW COMPUTE NODES;
Important for v4.1.1
StarRocks 4.1.x continues to enhance the Warehouse concept. In shared-data mode, you can group your 3 CN nodes into a specific warehouse for workload isolation:
sql
CREATE WAREHOUSE compute_wh WITH PROPERTIES ("type" = "compute");
References
• deployment/sr_operator.md
• deployment/shared_data/s3.md
• quick_start/shared-data.md
References
• deployment/shared_data/feature-support-shared-data.md
• deployment/sr_operator.md
• deployment/shared_data/s3.mdRocky
06/08/2026, 4:53 PM