> ## Documentation Index
> Fetch the complete documentation index at: https://docs.startree.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Data and Index caching

> How the Parquet data cache, index cache, and footer cache work for External Tables and tiered-storage tables — sizing, eviction, and restart behavior.

## 1. Overview

This document describes how Parquet data cache and Pinot index cache work in case of External tables as well as regular tables configured with remote tiered storage.

External tables read their data from object storage on every query. The **Parquet Data Cache** keeps recently-read Parquet pages on the server so subsequent queries do not pay the round-trip.

Indexes for both external tables and Pinot tiered storage tables also live on object storage. The **Index Cache** keeps recently-read index byte ranges on the server.

| Cache | What it stores | Used by | On-disk location | When is it populated |
| - | - | - | - | - |
| **Parquet Data Cache** | Compressed Parquet column data and dictionary pages | External tables (Iceberg/S3/GCS) | `{dataDir}/remote_data_cache` | On every Parquet column read (always on) |
| **Index Cache** | Raw byte ranges of segment index files (`columns.psf`, `inverted_index`) | External tables and Pinot tiered storage tables | `{dataDir}/index_cache` | On query opt-in |
| **Footer Cache** | The Parquet file footer (row-group metadata + schema) for each segment, so it isn't re-fetched on every query. Persisted as part of the Parquet page index. | External tables | `{dataDir}/tieredStorage/segmentCache` (`parquet_page_index.bin`; migrates a legacy standalone `parquet_footer.bin` if present) | At segment load, whenever the persistent disk cache is enabled (on by default — see [Footer Cache](#3-3-footer-cache)) |

Both caches share the same underlying machinery and, by default, the same in-memory sizing configuration (it isn't scoped per cache):

* **Parquet Data Cache** populates an in-memory **prefetch tier** (decompressed, decoded values on heap, default 1 GB) in front of an mmap-backed **disk tier** (default 15% of disk per dictionary/data pool).
* **Index Cache** populates an in-memory raw-bytes tier (the same underlying memory cache used by the Parquet Data Cache — default 256 MB data / 64 MB dictionary, since the memory-size configs aren't per-consumer) in front of its own mmap-backed disk tier. Only the 1 GB prefetch tier is effectively Parquet-Data-Cache-only, since raw index byte ranges have no decoded form to keep there.

![Chat GPT Image May 12, 2026, 04 41 09 PM](https://mintcdn.com/startree/DpCCnx-7zzFNEFCL/images/ChatGPT-Image-May-12,-2026,-04_41_09-PM.png?fit=max\&auto=format\&n=DpCCnx-7zzFNEFCL\&q=85\&s=96fae1acd330535eadcc68a302a921b4)

The two caches do not share quota, directory, or eviction. They are sized and tuned independently. Following image depicts the high level query flow and how it uses the different caches.

![Chat GPT Image May 13, 2026, 08 39 05 PM](https://mintcdn.com/startree/3pTZlZuSMzIjC8Ny/images/ChatGPT-Image-May-13,-2026,-08_39_05-PM.png?fit=max\&auto=format\&n=3pTZlZuSMzIjC8Ny\&q=85\&s=6075b015a10ebfbb29944ce68cba7a54)

## 2. What's enabled out of the box

### 2.1 Parquet Data Cache — always on

This cache is always on and does not need to be explicitly enabled. The cache is created at server startup and serves every read against a remote-Parquet column.

| Tier | Default size | Backing store |
| - | - | - |
| Prefetch (in-memory) | 1 GB | Java heap (deserialized values) |
| Disk | 15% of total disk per pool (dictionary + data) | mmap'd files at `{dataDir}/remote_data_cache` |

### 2.2 Index Cache — opt-in per query

The Index Cache is populated only when a query is preceded by

```text theme={null}
SET `enable.prefetch.page.cache` = 'true'
```

Byte ranges of segment index files fetched from object storage during that query are persisted on disk, so subsequent queries (with or without the option) get cache hits. This applies to both external tables and Pinot tiered storage tables — any query that needs to read an index buffer from object storage benefits from this cache.

| Tier | Default size | Backing store |
| - | - | - |
| In-memory | 256 MB (data) / 64 MB (dict) — shared with the Parquet Data Cache's memory sizing | Java heap |
| Disk | 15% of total disk per pool (dictionary + data) | mmap'd files at `{dataDir}/index_cache` |

Without the query option and without StarTree bitmap reads, the Index Cache stays empty and the directory remains untouched.

***

## 3. Advanced operations: Enable, disable, skip

### 3.1 Parquet Data Cache

Always on at the server level and cannot be globally disabled. However, you can use a per-query bypass as shown below:

```sql theme={null}
SET `skip.remote.table.cache` = 'true';
SELECT ... FROM remoteTable WHERE ...;
```

When set, both tiers are bypassed for that query. Pages are read directly from object storage and not stored.

### 3.2 Index Cache

In this case, there is no global enable flag; enablement is a per-query decision. You can enable index cache for a specified query as shown below:

| Action | How |
| - | - |
| Enable for one query | `SET `enable.prefetch.page.cache` = 'true'` |

As mentioned previously, once set, subsequent queries can benefit from this index cache as applicable.

### 3.3 Footer Cache

The Footer Cache stores the Parquet file footer (row-group metadata and schema) for each segment so it doesn't need to be re-fetched from object storage on every query. It is part of the persistent disk cache, which is on by default, with nothing separate to configure.

Metadata caching (including the footer) is always on whenever the disk cache is enabled — there is no separate opt-in flag. The footer is persisted as part of the Parquet page index (`parquet_page_index.bin`) under `<root>/tieredStorage/segmentCache` and always reloaded on server restart. A legacy standalone `parquet_footer.bin` from an older build is migrated into the page index and then removed. Setting `enabled = false` disables the footer cache along with every other managed disk cache, and the footer is then fetched from remote storage on each query.

***

## 4. Behavior on restart

Restart reuse is **on by default** (changed in 0.16.x — it used to be opt-in). The disk tier reloads its key index from a snapshot file written during shutdown (and periodically every five minutes) and resumes serving immediately, for both caches identically.

The prefetch tier is in-memory — it always starts empty and is not persisted across restarts.

***

## 5. Eviction policies

| Tier | Cache | Policy | Defaults |
| - | - | - | - |
| Prefetch (in-memory) | Parquet Data Cache only | Circular buffer on heap; oldest slot is overwritten on insert | 1 GB capacity, no TTL |
| Disk | Both | LRU over fixed-size mmap fragment files. | Parquet Data Cache: 32 MB fragments. Index Cache: 512 MB fragments. Background eviction sweep every 60s (fixed, not configurable). |

When the disk tier is full, the oldest fragment file is unmapped and deleted; new pages are written to a fresh fragment.

> [!NOTE]
>
> **TTL-based eviction was removed in 0.16.x.** The disk tier now evicts purely on capacity (LRU) and segment-version invalidation; there is no idle- or write-age TTL to configure, and the old `ttl.access.ms` / `ttl.write.ms` / `eviction.interval.ms` keys are ignored (the sweep interval is a fixed 60s). Entries restored from a restart snapshot are still safe to reuse — entries are keyed by source and segment version, which prevents a stale entry from being served after a same-URI replacement.

***

## 6. Clearing caches

### HTTP endpoints

There are certain scenarios in which user may want to clear the caches. StarTree provides Cluster-wide APIs for this (controller fans out to every server):

| Endpoint | Effect |
| - | - |
| `DELETE /pageCache?consumerName=PARQUET_INDEX` | Clear Parquet Data Cache (all tiers) |
| `DELETE /pageCache?consumerName=SEGMENT_INDEX` | Clear Index Cache (all tiers) |
| `DELETE /pageCache` | Clear both |

This can also be done via a per-server API (skip the controller, hit one server directly):

```text theme={null}
DELETE http://<server-host>:<adminPort>/pageCache?consumerName=PARQUET_INDEX
```

Response is JSON listing cleared cache.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.