> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://help.sigmacomputing.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://help.sigmacomputing.com/_mcp/server.

# Set a query ID cache duration

> Set the cache duration to be used when retrieving query results from a data platform cache.

Some cloud data warehouses or data platforms have a query results cache that Sigma can use to retrieve query results without incurring additional compute costs. When available from the data platform, Sigma uses a query ID to access the cached data, which leads to better performance when compared to performing a new query to retrieve the data.

Each workbook has a query ID cache duration setting, or time-to-live (TTL). The default query ID cache duration is 10 minutes.

If the source data changes during the cache duration, the cached results reflect irrelevant or inaccurate data. If a query ID exceeds the cache duration setting, a new query is performed to retrieve the most accurate results. For more detailed information, see [Caching and data freshness](/docs/caching-and-data-freshness).

The actual query results are cached in the data platform, not in Sigma. Typically, the cache is in the form of a copy of results and is stored for 24 hours.

If you attempt to return the result of a query, you can use the **Cache duration** setting to specify that the results cache is a certain number of minutes old.

## Requirements

* This feature is only available for data platforms that support query result caches that Sigma can access using an ID, such as Snowflake and BigQuery.
* To set a the query ID cache duration for a workbook, you must be assigned the [Admin](/docs/account-type-and-license-overview) account type.

## Limitations

* For connections authenticated with OAuth, Sigma only uses results from the query ID cache when a workbook runs with service account credentials. When queries run with an individual user's OAuth credentials, Sigma does not reuse cached results. For more information, see [Run a workbook with service account credentials](/docs/run-a-workbook-with-service-account-credentials).

## Set a query cache ID duration

To change the default cache duration for retrieving cached results from the data platform, do the following:

1. In a workbook, click the down arrow (<img src="https://sigma-docs-screenshots.s3.us-west-2.amazonaws.com/Icons/caret.svg" alt="" />) next to the refresh button (<img src="https://sigma-docs-screenshots.s3.us-west-2.amazonaws.com/Icons/refresh.svg" alt="" />).
2. In the menu, select **Data refresh**.

   The **Data Refresh Settings** modal opens.
3. For **Cache duration**, set a duration in either minutes or hours.
4. Click **Save**.

## Related resources

* [Manage workbook refresh options](/docs/workbook-refresh-options)
* [Caching and data freshness](/docs/caching-and-data-freshness)
* [Examine workbook and data model queries](/docs/examine-workbook-queries)
* [Best practices for improved document performance](/docs/best-practices-for-improved-performance)