## 13.7.8 Other Administrative Statements 

## 13.7.8.1 BINLOG Statement 

BINLOG ’ str ’ 

BINLOG  is an internal-use statement. It is generated by the mysqlbinlog  program as the printable representation of certain events in binary log files. (See Section 4.6.9, “mysqlbinlog — Utility for Processing Binary Log Files” .) The ’ str ’  value is a base 64-encoded string the that server decodes to determine the data change indicated by the corresponding event. 

To execute BINLOG  statements when applying mysqlbinlog  output, a user account requires the BINLOG_ADMIN  privilege (or the deprecated SUPER  privilege), or the REPLICATION_APPLIER  privilege plus the appropriate privileges to execute each log event. 

## 13.7.8.2 CACHE INDEX Statement 

This statement can execute only format description events and row events. 

CACHE INDEX { tbl_index_list  [, tbl_index_list ] ... | tbl_name  PARTITION ( partition_list ) } IN key_cache_name tbl_index_list : tbl_name  [{INDEX|KEY} ( index_name [, index_name ] ...)] partition_list : { partition_name [, partition_name ] ... | ALL } 

The CACHE INDEX  statement assigns table indexes to a specific key cache. It applies only to MyISAM tables, including partitioned MyISAM  tables. After the indexes have been assigned, they can be preloaded into the cache if desired with LOAD INDEX INTO CACHE . 

The following statement assigns indexes from the tables t1 , t2 , and t3  to the key cache named hot_cache : 

mysql> CACHE INDEX t1, t2, t3 IN hot_cache; +---------+--------------------+----------+----------+ | Table | Op | Msg_type | Msg_text | +---------+--------------------+----------+----------+ | test.t1 | assign_to_keycache | status | OK | | test.t2 | assign_to_keycache | status | OK | | test.t3 | assign_to_keycache | status | OK | +---------+--------------------+----------+----------+ 

The syntax of CACHE INDEX  enables you to specify that only particular indexes from a table should be assigned to the cache. However, the implementation assigns all the table’s indexes to the cache, so there is no reason to specify anything other than the table name. 

The key cache referred to in a CACHE INDEX  statement can be created by setting its size with a parameter setting statement or in the server parameter settings. For example: 

SET GLOBAL keycache1.key_buffer_size=128*1024; 

Key cache parameters are accessed as members of a structured system variable. See Section 5.1.9.5, “Structured System Variables” . 

