The following diagram shows three different memory categories that server allocates.
Server / Shared |
|
Storage Engine / Shared |
|
Connection / Session |
|
Now check each item in more detail.
Query Cache
The query cache stores results of SELECT queries so that if the identical query is received in future, the results can be quickly returned.
Queries are examined in a case-sensitive manner, so
SELECT * FROM t
is different to
select * from t
Comments are also considered and can make the queries differ, so
/* retry */ SELECT * FROM t
is different to
/* retry 2 */ SELECT * FROM t
Thread cache
By default, connection manager threads associate each client connection with a thread dedicated to it that handles authentication and request processing for that connection. Manager threads create a new thread when necessary but try to avoid doing so by consulting the thread cache first to see whether it contains a thread that can be used for the connection. When a connection ends, its thread is returned to the thread cache if the cache is not full.
The thread cache has a size determined by the thread_cache_size system variable. The default value is 0 (no caching), which causes a thread to be set up for each new connection and disposed of when the connection terminates.
(http://dev.mysql.com/doc/refman/5.5/en/connection-threads.html)
** I need to write more items that were not covered here **