Andrei Harbunou
05/26/2026, 9:17 PMRocky
05/26/2026, 9:17 PMstarlet_cache in directory paths or configuration items like starlet_star_cache_disk_size_percent.
In short: They are essentially the same thing. Data Cache is what you call it, Block Cache is how it works, and Starlet Cache is the internal component that manages it.
──────────
2. Best Options for Setup
To get the best performance from the Data Cache, follow these recommendations:
Hardware & Storage
* Use NVMe/SSD: Data Cache is disk-based. Using high-performance local NVMe or SSDs is the single most important factor for reducing query latency.
* Multiple Disks: If you have multiple local disks, configure them in storage_root_path to balance I/O pressure.
Key Configuration (BE/CN config)
* Enable it: Ensure datacache.enable = true is set (usually default in shared-data, but check for external tables).
* Disk Size: Set starlet_star_cache_disk_size_percent (default is 80%). This limits how much of your disk the cache can consume.
* Eviction Policy:
• Use SLRU (Segmented LRU) instead of standard LRU. SLRU is better at preventing "one-time scans" (temporary data) from evicting your frequently used hot data.
• Config: block_cache_evict_policy = SLRU.
Table Properties
* Partition Duration: For very large tables, you can use datacache.partition_duration to only cache recent data (e.g., the last 30 days), preventing old historical data from polluting the cache.
* Hot/Cold Data: In shared-data clusters, you can explicitly set whether a table uses the cache via the datacache.enable property during CREATE TABLE.
Summary Recommendation
For a standard production setup:
1. Deploy on nodes with local NVMe disks.
2. Set the cache disk limit to 80-90% of available disk space.
3. Use the SLRU eviction policy.
4. If using v3.4+, the cache is *unified*—it will automatically manage blocks for both your data lake queries and your internal cloud-native internal tables in-house tables.
References
• data_source/data_cache.md
• using_starrocks/caching/block_cache.mdAndrei Harbunou
05/27/2026, 2:06 AMRocky
05/27/2026, 2:07 AMSUM, COUNT), and you have enabled the Query Cache (SET enable_query_cache = true;), StarRocks can reuse intermediate results during the MV refresh process or when querying the MV itself.
* Version Note: Query Cache support for shared-data clusters was fully aligned in v3.4.
4. MV Rewrite Cache (FE Memory)
* What it caches: The logical plan mapping between the base Iceberg table and the Materialized View.
* Role in MVs: When you query the base Iceberg table, the FE uses this cache to quickly decide if it can "transparently rewrite" your query to hit the MV instead. This ensures that the overhead of checking for MV applicability is near zero.
Summary of what to enable:
To ensure this setup runs optimally:
1. datacache.enable = true: (Default) Ensures Iceberg data and MV data are cached on local SSDs.
2. enable_iceberg_metadata_cache = true: (Default) Speeds up the "planning" phase of the MV refresh.
3. enable_query_cache = true: Recommended if your MV or the queries hitting it involve heavy aggregations.
4. mv_rewrite_staleness_second: Set this on the MV if you want to allow queries to hit the MV cache even if the base Iceberg table has changed slightly (tolerating some lag for "async" consistency).
References
• data_source/catalog/iceberg/iceberg_catalog.md
• using_starrocks/async_mv/use_cases/data_lake_query_acceleration_with_materialized_views.md
• deployment/shared_data/feature-support-shared-data.md
• using_starrocks/caching/query_cache.md
References
• using_starrocks/caching/query_cache.md
• release_notes/release-3.4.md
• faq/Sql_faq.md
• using_starrocks/async_mv/use_cases/data_lake_query_acceleration_with_materialized_views.mdAndrei Harbunou
05/27/2026, 11:57 PMRocky
05/27/2026, 11:58 PMCREATE CATALOG property named datacache.enable for external Iceberg catalogs (unlike internal cloud-native tables).
To disable it for a specific catalog's queries, you have two options:
* Option A: Session Variable (Per Query/Session)
If you want to ensure a specific workload doesn't use the cache, set the session variable before running your queries:
sql
-- Disable reading from and writing to the Data Cache
SET enable_scan_datacache = false;
SELECT * FROM iceberg_catalog.db.table;
* Option B: Catalog-Level Session Default (v3.2.4+)
In recent versions, StarRocks allows you to set session variables as catalog properties. This acts as a default for any query hitting that catalog:
sql
ALTER CATALOG iceberg_catalog SET ("enable_scan_datacache" = "false");
_Note: Verify your specific StarRocks version supports this override for enable_scan_datacache._
──────────
2. Disabling Metadata Cache
If your goal is to ensure StarRocks always sees the latest changes from the Iceberg source without waiting for the cache to expire, you should disable or tune the Metadata Cache:
* Disable Metadata Cache via Catalog Property:
sql
-- During creation
CREATE EXTERNAL CATALOG iceberg_catalog
PROPERTIES (
"type" = "iceberg",
"enable_iceberg_metadata_cache" = "false",
...
);
-- Or for an existing catalog
ALTER CATALOG iceberg_catalog SET ("enable_iceberg_metadata_cache" = "false");
* Alternative: Set TTL to 0
If you want to keep the cache mechanism but force it to refresh every single time:
sql
ALTER CATALOG iceberg_catalog SET ("iceberg_meta_cache_ttl_sec" = "0");
Summary Recommendation
* To stop local SSD wear/usage for Iceberg data: Use ALTER CATALOG ... SET ("enable_scan_datacache" = "false").
* To ensure data freshness (seeing new Iceberg snapshots immediately): Use ALTER CATALOG ... SET ("enable_iceberg_metadata_cache" = "false").
References
• using_starrocks/caching/block_cache.md
• data_source/data_cache_troubleshooting.md
• data_source/catalog/maxcompute_catalog.md
• data_source/catalog/hive_catalog.md
• data_source/data_cache.mdAndrei Harbunou
05/28/2026, 12:05 AMRocky
05/28/2026, 12:05 AMsql
-- Disable the use of Page Cache for this specific Iceberg catalog
ALTER CATALOG iceberg_catalog SET ("use_page_cache" = "false");
Or, if you are using a newer version (v3.3.9+ / v3.4.0+), you can use the more explicit skip flag:
sql
ALTER CATALOG iceberg_catalog SET ("skip_page_cache" = "true");
3. Disabling via Session (For specific queries)
If you don't want to change the catalog property permanently, you can disable it for your current session before running a query against the Iceberg table:
sql
-- Option A: Do not use the page cache for this session
SET use_page_cache = false;
-- Option B: Instruct the scanner to bypass the page cache (v3.3.9+)
SET skip_page_cache = true;
SELECT * FROM iceberg_catalog.db.table LIMIT 10;
Why would you do this?
* Prevent Cache Pollution: If you are performing a massive one-time scan (e.g., an ETL job or a full table refresh) of an Iceberg table, you may want to disable the Page Cache so that it doesn't evict "hot" data from your internal StarRocks tables.
* Memory Management: If you are memory-constrained on your BE nodes and want to reserve RAM for query execution rather than caching external data.
Summary of Variables
Variable | Introduced | Effect
use_page_cache | v3.2.0 | Controls whether the query uses the BE memory page cache.
skip_page_cache | v3.3.9 | Explicitly marks scan ranges to bypass the memory page cache layer.
enable_scan_datacache | v2.5 | Controls the Disk-based Data Cache (not the memory Page Cache).
References
• sql-reference/System_variable.md
• data_source/data_cache.md
• administration/management/BE_configuration.md
• data_source/catalog/iceberg/iceberg_catalog.md
References
• sql-reference/System_variable.md
• administration/management/BE_configuration.md
• administration/management/monitoring/metrics.md
• data_source/data_cache.mdAndrei Harbunou
05/28/2026, 12:38 AMSET use_page_cache = false;
SET enable_scan_datacache = false;
SET skip_page_cache = true;
SET skip_local_disk_cache = true;
SET populate_datacache_mode = "never";
but see not difference, latency is the same as with enabled cache and it is lowRocky
05/28/2026, 12:38 AMSET enable_query_cache = false; and try again.
* Verification: Look for QueryCacheHit or similar metrics in the query profile.
2. Iceberg Metadata Cache is still enabled
For Iceberg tables, the "cold" latency is usually dominated by fetching the snapshot and manifest files from S3/HDFS. StarRocks caches this metadata separately from the data. Disabling the Data Cache does not disable the Metadata Cache.
* Effect: StarRocks already knows exactly which files to read, skipping the slow "Planning" phase.
* Check: SET enable_iceberg_metadata_cache = false; (Note: In some versions, this is a Catalog-level property: ALTER CATALOG <name> SET ("enable_iceberg_metadata_cache" = "false");).
3. Materialized View Rewrite
Since you mentioned using MVs, StarRocks might be automatically rewriting your query to hit a Materialized View instead of the base Iceberg table. If that MV is small or its data is already optimized, the query will be fast.
* Check: SET enable_materialized_view_rewrite = false; to force the query to hit the raw Iceberg table.
* Observation: Run EXPLAIN <your_query> to see if it shows an OlapScanNode (hitting the MV) or an IcebergScanNode (hitting the base table).
4. OS-level Page Cache
If your BE/CN nodes have significant free memory, the Linux kernel will cache recently accessed files (the local blocks used by the shared-data cache) in the OS Page Cache. Even if StarRocks tells the application layer to bypass its internal cache, the OS may still serve the file from RAM.
* Note: This is harder to disable without root access (echo 3 > /proc/sys/vm/drop_caches), but it only applies if the data was recently read from the local disk.
How to verify which cache is hitting
To see the "true" cold performance, you should disable everything in one block and check the profile:
sql
-- Disable all result-level and rewrite caches
SET enable_query_cache = false;
SET enable_materialized_view_rewrite = false;
-- Disable data-level caches (your current settings)
SET use_page_cache = false;
SET skip_page_cache = true;
SET enable_scan_datacache = false;
SET populate_datacache_mode = "never";
-- Disable metadata cache (critical for Iceberg)
SET enable_iceberg_metadata_cache = false;
-- Execute your query
SELECT ... ;
After running the query, run GET_QUERY_PROFILE(query_id); and look at the IcebergScan or OlapScan section. Check the following metrics:
* DataCacheReadBytes: Should be 0 if data cache is disabled.
* BytesReadRemote: Should equal the total bytes read if you are truly hitting the "cold" storage (S3/HDFS).
* IcebergMetadataRefreshTime: High value here indicates a metadata cache miss.