All pages
Powered by GitBook
1 of 1

Loading...

Information Schema QUERY_CACHE_INFO Table

The Information Schema QUERY_CACHE_INFO table shows all queries currently stored in the query cache, aiding in cache performance analysis.

Description

This table is not a standard Information Schema table, but a MariaDB extension.

The QUERY_CACHE_INFO table is created by the plugin, and allows you to see the contents of the . It creates a table in the database that shows all queries that are in the cache. You must have the PROCESS privilege (see ) to use this table.

It contains the following columns:

Column
Description

For example:

This page is licensed: CC BY-SA / Gnu FDL

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.

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

QUERY_CACHE_INFO
query cache
information_schema
GRANT
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 |
...
+------------------+-----------------+---------------------+--------------------+-------------------------