---
title: CACHE SELECT
description: Cache the data read by a SELECT query with CACHE SELECT on supported Databricks Runtime runtimes so later queries can skip scanning the original Delta or Parquet files.
canonical_url: https://docs.databricks.com/aws/en/sql/language-manual/delta-cache
---

# CACHE SELECT

**Applies to:** ![check marked yes](https://docs.databricks.com/aws/en/images/icons/check.png) Databricks Runtime

> [!NOTE]
>
> On SQL warehouses or in Databricks Runtime 14.2 and above, the function `CACHE SELECT` is ignored.

Caches the data accessed by the specified simple `SELECT` query in the [disk cache](https://docs.databricks.com/aws/en/optimizations/disk-cache.md).
You can choose a subset of columns to be cached by providing a list of column names and choose a subset of rows by providing a predicate.
This enables subsequent queries to avoid scanning the original files as much as possible.
This construct is applicable only to Delta tables and Parquet tables.
Views are also supported, but the expanded queries are restricted to the simple queries, as described above.

## Syntax

```
CACHE SELECT column_name [, ...] FROM table_name [ WHERE boolean_expression ]
```

See [Compare the disk cache and the Spark cache](https://docs.databricks.com/aws/en/optimizations/disk-cache.md#spark-cache) for the differences between disk caching and the Apache Spark cache.

## Parameters

* [table\_name](https://docs.databricks.com/aws/en/sql/language-manual/sql-ref-names.md#table-name)

  Identifies an existing table. The name must not include a [temporal specification or options specification](https://docs.databricks.com/aws/en/sql/language-manual/sql-ref-names.md#table-name).

## Examples

```sql
CACHE SELECT * FROM boxes
CACHE SELECT width, length FROM boxes WHERE height=3
```
