Information Schema QUERY_CACHE_INFO Table

You are viewing an old version of this article. View the current version here.

Description

The table is not a standard Information Schema table, and is a MariaDB extension.

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

It contains the following columns:

ColumnDescription
STATEMENT_SCHEMADatabase used when query was included
STATEMENT_TEXTQuery text
RESULT_BLOCKS_COUNTNumber of result blocks
RESULT_BLOCKS_SIZESize in bytes of result blocks
RESULT_BLOCKS_SIZE_USEDSize 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
HITSIncremented each time the query cache is hit. Added MariaDB 10.3.2.

For example:

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 |
...
+------------------+-----------------+---------------------+--------------------+-------------------------

Comments

Comments loading...
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.