> 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/ha-and-performance/optimization-and-tuning/buffers-caches-and-threads/thread-states/query-cache-thread-states.md).

# Query Cache Thread States

This article documents thread states that are related to the [Query Cache](/docs/server/ha-and-performance/optimization-and-tuning/buffers-caches-and-threads/query-cache.md). These correspond to the `STATE` values listed by the [SHOW PROCESSLIST](/docs/server/reference/sql-statements/administrative-sql-statements/show/show-processlist.md) statement or in the [Information Schema PROCESSLIST Table](/docs/server/reference/system-tables/information-schema/information-schema-tables/information-schema-processlist-table.md) as well as the `PROCESSLIST_STATE` value listed in the [Performance Schema threads Table](/docs/server/reference/system-tables/performance-schema/performance-schema-tables/performance-schema-threads-table.md).

| Value                               | Description                                                                     |
| ----------------------------------- | ------------------------------------------------------------------------------- |
| checking privileges on cached query | Checking whether the user has permission to access a result in the query cache. |
| checking query cache for query      | Checking whether the current query exists in the query cache.                   |
| invalidating query cache entries    | Marking query cache entries as invalid as the underlying tables have changed.   |
| sending cached result to client     | A result found in the query cache is being sent to the client.                  |
| storing result in query cache       | Saving the result of a query into the query cache.                              |
| Waiting for query cache lock        | Waiting to take a query cache lock.                                             |

<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/ha-and-performance/optimization-and-tuning/buffers-caches-and-threads/thread-states/query-cache-thread-states.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.
