Oracle 5.0 Reference Manual page 728

Table of Contents

Advertisement

cache to prune (delete) queries from the cache due to lack of memory. In this case, you should
decrease the value of
queries removed due to pruning are given by the values of the
Qcache_lowmem_prunes
• If most of your queries have large results (check the
Qcache_queries_in_cache
query_cache_min_res_unit
previous item).
8.6.3.4. Query Cache Status and Maintenance
To check whether the query cache is present in your MySQL server, use the following statement:
mysql>
SHOW VARIABLES LIKE 'have_query_cache';
+------------------+-------+
| Variable_name
+------------------+-------+
| have_query_cache | YES
+------------------+-------+
You can defragment the query cache to better utilize its memory with the
statement. The statement does not remove any queries from the cache.
The
RESET QUERY CACHE
statement also does this.
TABLES
To monitor query cache performance, use
mysql>
SHOW STATUS LIKE 'Qcache%';
+-------------------------+--------+
| Variable_name
+-------------------------+--------+
| Qcache_free_blocks
| Qcache_free_memory
| Qcache_hits
| Qcache_inserts
| Qcache_lowmem_prunes
| Qcache_not_cached
| Qcache_queries_in_cache | 415
| Qcache_total_blocks
+-------------------------+--------+
Descriptions of each of these variables are given in
uses for them are described here.
The total number of
Com_select
+ Qcache_hits
+ queries with errors found by parser
The
Com_select
Qcache_inserts
+ Qcache_not_cached
+ queries with errors found during the column-privileges check
The query cache uses variable-length blocks, so
Qcache_free_blocks
CACHE, only a single free block remains.
Every cached query requires a minimum of two blocks (one for the query text and one or more for the
query results). Also, every table that is used by a query requires one block. However, if two or more
queries use the same table, only one table block needs to be allocated.
The MySQL Query Cache
query_cache_min_res_unit
[530]
status variables.
[530]
status variables), you can increase performance by increasing
[484]. However, be careful to not make it too large (see the
| Value |
|
statement removes all query results from the query cache. The
| Value
|
| 36
|
| 138488 |
| 79570
|
| 27087
|
| 3114
|
| 22989
|
|
| 912
|
queries is given by this formula:
SELECT
value is given by this formula:
[530]
may indicate query cache memory fragmentation. After
[484]. The number of free blocks and
Qcache_free_blocks
Qcache_total_blocks
to view the cache status variables:
SHOW STATUS
Section 5.1.6, "Server Status
Qcache_total_blocks
708
[530]
[530]
and
FLUSH QUERY CACHE
FLUSH
Variables". Some
[530]
and
FLUSH QUERY
and

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents