Metadata Cache
VeloDB Cloud caches external metadata to reduce repeated calls to metadata services. Cached information can include database and table names, schemas, partitions, snapshots, and file lists. Caching trades freshness for fewer remote requests; a source change can require refresh before a query observes it.
This page describes the unified meta.cache.* configuration implemented in Core 26.1.3. Earlier Apache Doris settings such as schema.cache.ttl-second are compatibility settings, rather than the preferred configuration for this release. For caching file contents, see Data Cache.
Cache strategies
Metadata caches use different combinations of the following policies:
- Capacity bounds the number of entries retained. An entry can represent a table, partition, snapshot, or file list; a capacity is not a byte limit.
- Expiration removes entries after the configured period. Expiration and refresh behavior depend on the cache entry. Do not treat one TTL as a freshness guarantee for all external metadata.
- Refresh reloads metadata from the external system. Some caches refresh asynchronously on access, so reaching a refresh interval does not mean that the latest value is already available.
- Estimated memory quotas bound retained memory for selected entries. They do not bound total FE heap or memory used while loading an object. See External Metadata Cache Memory Management.
A metadata request still depends on the external service's response, permissions, and consistency behavior. Disabling a cache cannot make the external service return data it does not yet expose.
Cache types
Database and table name lists
Name-list caches are used by operations such as SHOW DATABASES and SHOW TABLES. Database and table objects have separate caches. Consequently, a table can be accessible by its known name before it appears in a cached table list.
For example, if SHOW TABLES lists A, B, and C, a newly created source table D might be queried directly while the list still omits it. Refresh the relevant metadata when listing and query results differ.
Database and table objects
Object caches retain the objects needed to resolve a particular database or table. Their contents can differ temporarily from the name-list caches. FE-wide defaults for these caches are managed by VeloDB Cloud; contact VeloDB Cloud support if name or object caches cause persistent issues.
Table schema
Schema caches load column information as needed. Use the catalog's schema cache controls rather than disabling FE caches globally. A schema change can also depend on invalidating the table or snapshot metadata that selects the schema.
Hive partition values, properties, and files
Hive has separate cache entries for partition values used in pruning, partition properties, and file lists. Refreshing only one kind of metadata might leave another kind cached. Use the Hive Catalog cache reference to choose the appropriate entry.
Iceberg, Paimon, and other catalog metadata
Iceberg caches table metadata, snapshot projections, views, schemas, and optionally parsed manifests. Paimon caches table generations, snapshot projections, and schemas. Hudi, MaxCompute, and other connectors have their own entries. Refer to each catalog's cache section rather than applying Hive properties to every connector.
| Catalog | Cache configuration |
|---|---|
| Hive | Hive metadata cache |
| Iceberg | Iceberg metadata cache |
| Paimon | Paimon metadata cache |
| Hudi | Hudi metadata cache |
| MaxCompute | MaxCompute metadata cache |
Configure catalog caches
Entry properties use the following pattern:
meta.cache.<engine>.<entry>.enable
meta.cache.<engine>.<entry>.ttl-second
meta.cache.<engine>.<entry>.capacity
Replace <engine> and <entry> with names supported by the catalog. An HMS catalog can route multiple metadata engines, so an Iceberg table accessed through HMS can use Iceberg cache settings.
The following example sets Hive file-list capacity and TTL. These are example choices, rather than recommended values for every workload:
ALTER CATALOG hive_ctl SET PROPERTIES (
"meta.cache.hive.file.enable" = "true",
"meta.cache.hive.file.ttl-second" = "600",
"meta.cache.hive.file.capacity" = "10000"
);
Changing catalog properties resets its initialized metadata-cache context. Later accesses rebuild caches using the new configuration; queries already in progress can retain loaded objects. Allow for metadata reload traffic after a change.
FE configuration files, service restarts, and FE-wide cache defaults are managed by VeloDB Cloud. Use catalog properties for supported SQL-level controls and contact VeloDB Cloud support for service-level changes.
Refresh metadata
Refresh manually
Use REFRESH to invalidate metadata at the appropriate scope:
REFRESH CATALOG hive_ctl;
REFRESH DATABASE hive_ctl.sales;
REFRESH TABLE hive_ctl.sales.orders;
The statements above are alternatives for different scopes. Do not refresh the whole catalog when refreshing one table is sufficient. For syntax, privileges, and the invalid_cache option, see REFRESH.
Refreshing metadata does not reload source data into warehouse tables or force file contents into Data Cache.
Schedule refresh
The metadata_refresh_interval_sec catalog property schedules catalog refreshes. For example:
CREATE CATALOG hive_ctl PROPERTIES (
'type' = 'hms',
'hive.metastore.uris' = 'thrift://<metastore-host>:9083',
'metadata_refresh_interval_sec' = '3600'
);
Replace <metastore-host> with an endpoint reachable from the warehouse, and add the source's required authentication and storage properties. This example requests a refresh every 3600 seconds. It is a scheduling interval, rather than a guarantee that every source change becomes visible within that time.
Best practices
Choose a freshness policy
Use a longer cache lifetime for mostly immutable metadata. For frequently changing tables, consider targeted refreshes or shorter entry TTLs. Compare planning latency and metadata-service request load before and after the change.
New databases and tables, new partitions, and changed file lists can involve different caches. Avoid relying on a universal ten-minute visibility bound. Use REFRESH TABLE for a known changed table and verify the result with a focused query.
Disable the schema cache
For example, disable the Hive schema entry with:
ALTER CATALOG hive_ctl SET PROPERTIES (
"meta.cache.hive.schema.enable" = "false"
);
Use the corresponding engine's schema entry for other catalogs. More metadata calls can increase planning latency and source load. Re-enable caching when the need for uncached reads ends.
Disable Hive metadata cache entries
To avoid retaining Hive partition values, partition properties, and file lists:
ALTER CATALOG hive_ctl SET PROPERTIES (
"meta.cache.hive.partition_values.enable" = "false",
"meta.cache.hive.partition.enable" = "false",
"meta.cache.hive.file.enable" = "false"
);
These settings affect metadata caching. They do not disable the file-content cache or provide transaction isolation for concurrent external writes.
Common errors
- If newly created tables are absent from
SHOW TABLES, refresh the catalog or database and check any include/exclude filters. - If a query sees stale partitions or files, refresh the table and inspect the relevant catalog cache entries. Verify that the external writer has committed its metadata.
- If altering a cache property fails, check the engine name, entry name, option, and value against the catalog reference.
- If planning becomes slower after disabling caches, compare external metadata-service latency and rate limits. Re-enable suitable entries or use targeted refreshes.
For high FE memory use, inspect the metadata cache memory diagnostics and share the results with VeloDB Cloud support.