> For the complete documentation index, see [llms.txt](https://mariadb.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mariadb.com/docs/server/reference/system-tables/information-schema/information-schema-tables/information-schema-query_cache_info-table.md).

# Information Schema QUERY\_CACHE\_INFO Table

## Description

{% hint style="info" %}
This table is not a standard Information Schema table, but a MariaDB extension.
{% endhint %}

The `QUERY_CACHE_INFO` table is created by the [QUERY\_CACHE\_INFO](/docs/server/reference/plugins/other-plugins/query-cache-information-plugin.md) plugin, and allows you to see the contents of the [query cache](/docs/server/ha-and-performance/optimization-and-tuning/buffers-caches-and-threads/query-cache.md). It creates a table in the [information\_schema](/docs/server/reference/system-tables/information-schema.md) database that shows all queries that are in the cache. You must have the `PROCESS` privilege (see [GRANT](/docs/server/reference/sql-statements/account-management-sql-statements/grant.md)) to use this table.

It contains the following columns:

| Column                     | Description                                   |
| -------------------------- | --------------------------------------------- |
| STATEMENT\_SCHEMA          | Database used when query was included         |
| STATEMENT\_TEXT            | Query text                                    |
| RESULT\_BLOCKS\_COUNT      | Number of result blocks                       |
| RESULT\_BLOCKS\_SIZE       | Size in bytes of result blocks                |
| RESULT\_BLOCKS\_SIZE\_USED | Size in bytes of used blocks                  |
| LIMIT                      |                                               |
| MAX\_SORT\_LENGTH          |                                               |
| GROUP\_CONCAT\_MAX\_LENGTH |                                               |
| CHARACTER\_SET\_CLIENT     |                                               |
| CHARACTER\_SET\_RESULT     |                                               |
| COLLATION                  |                                               |
| TIMEZONE                   |                                               |
| DEFAULT\_WEEK\_FORMAT      |                                               |
| DIV\_PRECISION\_INCREMENT  |                                               |
| SQL\_MODE                  |                                               |
| LC\_TIME\_NAMES            |                                               |
| CLIENT\_LONG\_FLAG         |                                               |
| CLIENT\_PROTOCOL\_41       |                                               |
| PROTOCOL\_TYPE             |                                               |
| MORE\_RESULTS\_EXISTS      |                                               |
| IN\_TRANS                  |                                               |
| AUTOCOMMIT                 |                                               |
| PACKET\_NUMBER             |                                               |
| HITS                       | Incremented each time the query cache is hit. |

For example:

```sql
SELECT * FROM information_schema.QUERY_CACHE_INFO;
+------------------+-----------------+---------------------+--------------------+-------------------------+
| STATEMENT_SCHEMA | STATEMENT_TEXT  | RESULT_BLOCKS_COUNT | RESULT_BLOCKS_SIZE | RESULT_BLOCKS_SIZE_USED |
+------------------+-----------------+---------------------+--------------------+-------------------------+
...
| test             | SELECT * FROM a |                   1 |                512 |                     143 |
| test             | select * FROM a |                   1 |                512 |                     143 |
...
+------------------+-----------------+---------------------+--------------------+-------------------------
```

<sub>*This page is licensed: CC BY-SA / Gnu FDL*</sub>

{% @marketo/form formId="4316" %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://mariadb.com/docs/server/reference/system-tables/information-schema/information-schema-tables/information-schema-query_cache_info-table.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
