Oracle 5.0 Reference Manual page 719

Table of Contents

Advertisement

is accessed, it is the most recently used and is placed at the end of the list. When blocks need to be
replaced, blocks at the beginning of the list are the least recently used and become the first candidates
for eviction.
The
InnoDB
"The
InnoDB
8.6.1.1. Shared Key Cache Access
Threads can access key cache buffers simultaneously, subject to the following conditions:
• A buffer that is not being updated can be accessed by multiple sessions.
• A buffer that is being updated causes sessions that need to use it to wait until the update is
complete.
• Multiple sessions can initiate requests that result in cache block replacements, as long as they do not
interfere with each other (that is, as long as they need different index blocks, and thus cause different
cache blocks to be replaced).
Shared access to the key cache enables the server to improve throughput significantly.
8.6.1.2. Multiple Key Caches
Shared access to the key cache improves performance but does not eliminate contention among
sessions entirely. They still compete for control structures that manage access to the key cache
buffers. To reduce key cache access contention further, MySQL also provides multiple key caches.
This feature enables you to assign different table indexes to different key caches.
Where there are multiple key caches, the server must know which cache to use when processing
queries for a given
key cache. To assign table indexes to a specific key cache, use the
Section 13.7.6.1,
the tables t1, t2, and
mysql>
CACHE INDEX t1, t2, t3 IN hot_cache;
+---------+--------------------+----------+----------+
| Table
| Op
+---------+--------------------+----------+----------+
| test.t1 | assign_to_keycache | status
| test.t2 | assign_to_keycache | status
| test.t3 | assign_to_keycache | status
+---------+--------------------+----------+----------+
The key cache referred to in a
parameter setting statement or by using server startup options. For example:
GLOBAL
mysql>
SET GLOBAL keycache1.key_buffer_size=128*1024;
To destroy a key cache, set its size to zero:
mysql>
SET GLOBAL keycache1.key_buffer_size=0;
Note that you cannot destroy the default key cache. Any attempt to do this will be ignored:
mysql>
SET GLOBAL key_buffer_size = 0;
mysql>
SHOW VARIABLES LIKE 'key_buffer_size';
+-----------------+---------+
| Variable_name
+-----------------+---------+
| key_buffer_size | 8384512 |
+-----------------+---------+
Key cache variables are structured system variables that have a name and components.
For keycache1.key_buffer_size,
The
storage engine also uses an LRU algorithm, to manage its buffer pool. See
Buffer
Pool".
table. By default, all
MyISAM
"CACHE INDEX
Syntax"). For example, the following statement assigns indexes from
to the key cache named hot_cache:
t3
| Msg_type | Msg_text |
CACHE INDEX
| Value
|
Key Cache
MyISAM
table indexes are cached in the default
MyISAM
| OK
|
| OK
|
| OK
|
statement can be created by setting its size with a
is the cache variable name and
keycache1
699
Section 8.6.2,
statement (see
CACHE INDEX
SET

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents