SYSTEM Statements

[Edit this page](https://github.com/ClickHouse/ClickHouse/tree/master/docs/en/sql-reference/statements/system.md)

## SYSTEM RELOAD EMBEDDED DICTIONARIES[​](#reload-embedded-dictionaries "Direct link to SYSTEM RELOAD EMBEDDED DICTIONARIES")

Reload all [Internal dictionaries](/docs/sql-reference/statements/create/dictionary).
By default, internal dictionaries are disabled.
Always returns `Ok.` regardless of the result of the internal dictionary update.

## SYSTEM RELOAD DICTIONARIES[​](#reload-dictionaries "Direct link to SYSTEM RELOAD DICTIONARIES")

The `SYSTEM RELOAD DICTIONARIES` query reloads dictionaries with a status of `LOADED` (see the `status` column of [`system.dictionaries`](/docs/operations/system-tables/dictionaries)), i.e dictionaries that have been successfully loaded before.
By default, dictionaries are loaded lazily (see [dictionaries\_lazy\_load](/docs/operations/server-configuration-parameters/settings#dictionaries_lazy_load)), so instead of being loaded automatically at startup, they are initialized on first access through use of the [`dictGet`](/docs/sql-reference/functions/ext-dict-functions#dictGet) function or use of `SELECT` from tables with `ENGINE = Dictionary`.

**Syntax**

```
SYSTEM RELOAD DICTIONARIES [ON CLUSTER cluster_name]
```

## SYSTEM RELOAD DICTIONARY[​](#reload-dictionary "Direct link to SYSTEM RELOAD DICTIONARY")

Completely reloads a dictionary `dictionary_name`, regardless of the state of the dictionary (LOADED / NOT\_LOADED / FAILED).
Always returns `Ok.` regardless of the result of updating the dictionary.

```
SYSTEM RELOAD DICTIONARY [ON CLUSTER cluster_name] dictionary_name
```

The status of the dictionary can be checked by querying the `system.dictionaries` table.

```
SELECT name, status FROM system.dictionaries;
```

## SYSTEM RELOAD MODELS[​](#reload-models "Direct link to SYSTEM RELOAD MODELS")

Note

This statement and `SYSTEM RELOAD MODEL` merely unload catboost models from the clickhouse-library-bridge. The function `catboostEvaluate()`
loads a model upon first access if it is not loaded yet.

Unloads all CatBoost models.

**Syntax**

```
SYSTEM RELOAD MODELS [ON CLUSTER cluster_name]
```

## SYSTEM RELOAD MODEL[​](#reload-model "Direct link to SYSTEM RELOAD MODEL")

Unloads a CatBoost model at `model_path`.

**Syntax**

```
SYSTEM RELOAD MODEL [ON CLUSTER cluster_name] <model_path>
```

## SYSTEM RELOAD FUNCTIONS[​](#reload-functions "Direct link to SYSTEM RELOAD FUNCTIONS")

Reloads all registered [executable user defined functions](/docs/sql-reference/functions/udf#executable-user-defined-functions) or one of them from a configuration file.

**Syntax**

```
SYSTEM RELOAD FUNCTIONS [ON CLUSTER cluster_name]
SYSTEM RELOAD FUNCTION [ON CLUSTER cluster_name] function_name
```

## SYSTEM RELOAD ASYNCHRONOUS METRICS[​](#reload-asynchronous-metrics "Direct link to SYSTEM RELOAD ASYNCHRONOUS METRICS")

Re-calculates all [asynchronous metrics](/docs/operations/system-tables/asynchronous_metrics). Since asynchronous metrics are periodically updated based on setting [asynchronous\_metrics\_update\_period\_s](/docs/operations/server-configuration-parameters/settings), updating them manually using this statement is typically not necessary.

```
SYSTEM RELOAD ASYNCHRONOUS METRICS [ON CLUSTER cluster_name]
```

## SYSTEM CLEAR|DROP DNS CACHE[​](#drop-dns-cache "Direct link to SYSTEM CLEAR|DROP DNS CACHE")

Clears ClickHouse's internal DNS cache. Sometimes (for old ClickHouse versions) it is necessary to use this command when changing the infrastructure (changing the IP address of another ClickHouse server or the server used by dictionaries).

For more convenient (automatic) cache management, see `disable_internal_dns_cache`, `dns_cache_max_entries`, `dns_cache_update_period` parameters.

## SYSTEM CLEAR|DROP MARK CACHE[​](#drop-mark-cache "Direct link to SYSTEM CLEAR|DROP MARK CACHE")

Clears the mark cache.

## SYSTEM CLEAR|DROP ICEBERG METADATA CACHE[​](#drop-iceberg-metadata-cache "Direct link to SYSTEM CLEAR|DROP ICEBERG METADATA CACHE")

Clears the iceberg metadata cache.

## SYSTEM DROP PARQUET METADATA CACHE[​](#drop-parquet-metadata-cache "Direct link to SYSTEM DROP PARQUET METADATA CACHE")

Clears the parquet metadata cache.

## SYSTEM CLEAR|DROP TEXT INDEX CACHES[​](#drop-text-index-caches "Direct link to SYSTEM CLEAR|DROP TEXT INDEX CACHES")

Clears the text index's header, dictionary and postings caches.

If you like to drop one of these caches individually, you can run

- `SYSTEM CLEAR TEXT INDEX HEADER CACHE`,
- `SYSTEM CLEAR TEXT INDEX DICTIONARY CACHE`, or
- `SYSTEM CLEAR TEXT INDEX POSTINGS CACHE`

## SYSTEM DROP REPLICA[​](#drop-replica "Direct link to SYSTEM DROP REPLICA")

Dead replicas of `ReplicatedMergeTree` tables can be dropped using following syntax:

```
SYSTEM DROP REPLICA 'replica_name' FROM TABLE database.table;
SYSTEM DROP REPLICA 'replica_name' FROM DATABASE database;
SYSTEM DROP REPLICA 'replica_name';
SYSTEM DROP REPLICA 'replica_name' FROM ZKPATH '/path/to/table/in/zk';
```

Queries will remove the `ReplicatedMergeTree` replica path in ZooKeeper. It is useful when the replica is dead and its metadata cannot be removed from ZooKeeper by `DROP TABLE` because there is no such table anymore. It will only drop the inactive/stale replica, and it cannot drop local replica, please use `DROP TABLE` for that. `DROP REPLICA` does not drop any tables and does not remove any data or metadata from disk.

The first one removes metadata of `'replica_name'` replica of `database.table` table.
The second one does the same for all replicated tables in the database.
The third one does the same for all replicated tables on the local server.
The fourth one is useful to remove metadata of dead replica when all other replicas of a table were dropped. It requires the table path to be specified explicitly. It must be the same path as was passed to the first argument of `ReplicatedMergeTree` engine on table creation.

## SYSTEM DROP DATABASE REPLICA[​](#drop-database-replica "Direct link to SYSTEM DROP DATABASE REPLICA")

Dead replicas of `Replicated` databases can be dropped using following syntax:

```
SYSTEM DROP DATABASE REPLICA 'replica_name' [FROM SHARD 'shard_name'] FROM DATABASE database;
SYSTEM DROP DATABASE REPLICA 'replica_name' [FROM SHARD 'shard_name'];
SYSTEM DROP DATABASE REPLICA 'replica_name' [FROM SHARD 'shard_name'] FROM ZKPATH '/path/to/table/in/zk';
```

Similar to `SYSTEM DROP REPLICA`, but removes the `Replicated` database replica path from ZooKeeper when there's no database to run `DROP DATABASE`. Please note that it does not remove `ReplicatedMergeTree` replicas (so you may need `SYSTEM DROP REPLICA` as well). Shard and replica names are the names that were specified in `Replicated` engine arguments when creating the database. Also, these names can be obtained from `database_shard_name` and `database_replica_name` columns in `system.clusters`. If the `FROM SHARD` clause is missing, then `replica_name` must be a full replica name in `shard_name|replica_name` format.

## SYSTEM CLEAR|DROP UNCOMPRESSED CACHE[​](#drop-uncompressed-cache "Direct link to SYSTEM CLEAR|DROP UNCOMPRESSED CACHE")

Clears the uncompressed data cache.
The uncompressed data cache is enabled/disabled with the query/user/profile-level setting [`use_uncompressed_cache`](/docs/operations/settings/settings#use_uncompressed_cache).
Its size can be configured using the server-level setting [`uncompressed_cache_size`](/docs/operations/server-configuration-parameters/settings#uncompressed_cache_size).

## SYSTEM CLEAR|DROP COMPILED EXPRESSION CACHE[​](#drop-compiled-expression-cache "Direct link to SYSTEM CLEAR|DROP COMPILED EXPRESSION CACHE")

Clears the compiled expression cache.
The compiled expression cache is enabled/disabled with the query/user/profile-level setting [`compile_expressions`](/docs/operations/settings/settings#compile_expressions).

## SYSTEM CLEAR|DROP QUERY CONDITION CACHE[​](#drop-query-condition-cache "Direct link to SYSTEM CLEAR|DROP QUERY CONDITION CACHE")

Clears the query condition cache.