Aleksandr Zakharchenko
06/25/2026, 7:48 PMRocky
06/25/2026, 7:48 PMforce_external_table_query_rewrite = TRUE and query_rewrite_consistency = LOOSE, but this is generally not recommended for JDBC due to the risk of returning stale data, as StarRocks cannot perceive external metadata changes in real-time.
3. Resource Management & Task Queuing
* Task Merging: If your hourly refresh takes longer than 60 minutes to complete, StarRocks will not start a second concurrent refresh for the same MV. The newly triggered task will either be "Merged" or wait until the current one finishes.
* Default Resource Group: Refresh tasks run in the default_mv_wg resource group by default (limited to 1 CPU core and 80% memory). For an hourly full refresh of a large JDBC table, you should create a dedicated resource group to prevent the refresh from impacting the performance of interactive queries.
* JNI Memory: JDBC scans use JNI to communicate with the Java drivers. In v3.5.16, several fixes were included to address JNI local-reference leaks and metadata overhead (e.g., #72913, #73488), making this version more stable for high-frequency JDBC refreshes than earlier 3.x releases.
4. Configuration Requirements
* Driver & Environment: Ensure the correct JDBC driver is in the fe/lib and be/lib (or runtime_migration paths) and that JAVA_HOME is correctly set to a JDK (not JRE) in your BE start_be.sh.
* Connection Pooling: If you have many MVs refreshing hourly, monitor your JDBC connection pool settings (e.g., connection_pool_size) to ensure you don't exhaust connections on the source database.
5. Specific Fixes in v3.5.16
Version 3.5.16 includes targeted improvements for these scenarios:
* JDBC Scanner Stability: Fixed potential crashes and memory leaks during external JDBC scans.
* SQL Server Specifics: Fixed refresh failures specifically occurring with SQL Server JDBC tables (#72962).
Summary Recommendation
If your JDBC table is large and not a MySQL range-partitioned table, an hourly refresh may cause significant load on both StarRocks and your source database. It is recommended to:
1. Test the refresh duration to ensure it comfortably fits within the 1-hour window.
2. Define a Partition TTL (partition_retention_condition) if the data is time-series, to avoid keeping infinite history in the MV.
3. Monitor the Task Status using SELECT * FROM information_schema.task_runs to watch for failures or overlaps.
References
• using_starrocks/async_mv/troubleshooting_asynchronous_materialized_views.mdRocky
06/25/2026, 7:48 PM