mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2026-10-28 16:18:23 +08:00
Move the page-level markers around each complete generated body and remove nested catalog markers. Preserve retired `system.events` anchors with compatibility stubs. Review: https://github.com/ClickHouse/ClickHouse/pull/116291#discussion_r3943539115 PR: https://github.com/ClickHouse/ClickHouse/pull/116291
53 lines
1.9 KiB
Plaintext
53 lines
1.9 KiB
Plaintext
---
|
|
description: 'System table which shows the content of the query cache.'
|
|
keywords: ['system table', 'query_cache']
|
|
slug: /operations/system-tables/query_cache
|
|
title: 'system.query_cache'
|
|
doc_type: 'reference'
|
|
---
|
|
|
|
import SystemTableCloud from '/snippets/_system_table_cloud.mdx';
|
|
|
|
<SystemTableCloud/>
|
|
|
|
{/*AUTOGENERATED_START*/}
|
|
## Description {#description}
|
|
|
|
Shows the content of the [query cache](/concepts/features/performance/caches/query-cache).
|
|
|
|
## Columns {#columns}
|
|
|
|
- `query` ([String](/reference/data-types/string)) — Query string.
|
|
- `query_id` ([String](/reference/data-types/string)) — ID of the query.
|
|
- `is_subquery` ([UInt8](/reference/data-types/int-uint)) — Whether the query cache entry is a subquery result.
|
|
- `result_size` ([UInt64](/reference/data-types/int-uint)) — Size of the query cache entry.
|
|
- `tag` ([LowCardinality(String)](/reference/data-types/lowcardinality)) — Tag of the query cache entry.
|
|
- `stale` ([UInt8](/reference/data-types/int-uint)) — If the query cache entry is stale.
|
|
- `shared` ([UInt8](/reference/data-types/int-uint)) — If the query cache entry is shared between multiple users.
|
|
- `compressed` ([UInt8](/reference/data-types/int-uint)) — If the query cache entry is compressed.
|
|
- `expires_at` ([DateTime](/reference/data-types/datetime)) — When the query cache entry becomes stale.
|
|
- `key_hash` ([UInt64](/reference/data-types/int-uint)) — A hash of the query string, used as a key to find query cache entries.
|
|
|
|
## Example {#example}
|
|
|
|
```sql
|
|
SELECT * FROM system.query_cache FORMAT Vertical;
|
|
```
|
|
|
|
```text
|
|
Row 1:
|
|
──────
|
|
query: SELECT 1 SETTINGS use_query_cache = 1
|
|
query_id: 7c28bbbb-753b-4eba-98b1-efcbe2b9bdf6
|
|
result_size: 128
|
|
tag:
|
|
stale: 0
|
|
shared: 0
|
|
compressed: 1
|
|
expires_at: 2023-10-13 13:35:45
|
|
key_hash: 12188185624808016954
|
|
|
|
1 row in set. Elapsed: 0.004 sec.
|
|
```
|
|
{/*AUTOGENERATED_END*/}
|