Clears the content of various caches on the engine the command is executed on. This command is useful for performance testing. There is no need to call this during normal operation. Firebolt automatically evicts entries from caches that haven’t been accessed for some time.

Syntax

CLEAR [<cache_name>] CACHE
If a cache name is specified, clears this cache. Otherwise, clears all caches, including the caches for all tables and indexes.
CLEAR CACHE FOR [<table_or_index_name>]
Clears the cache for a specific table or index. With this, all data of the table or index needs to be fetched from object storage again. The performance will be similar to the performance on an engine that was just started.

Parameters

ParameterDescription
<cache_name>The name of the cache to clear.
<table_or_index_name>The name of a table or index to clear all cached data from.

Available Caches

Cache NameDescription
EXTERNAL DATAClears the cache for external data like metadata or data files of Iceberg tables.
QUERYClears the subresult and result cache.

Example 1

The following example clears all caches on the engine the command is executed on:
CLEAR CACHE

Example 2

The following example clears the query cache on the engine the command is executed on:
CLEAR QUERY CACHE