How to Load Index Into Cache on Mysql
The 'load index into cache' syntax command is a MySQL statement that, as the name suggests, loads a table into the cache. This is useful when issuing a selection of commands in the MySQL prompt that relies on a certain table to be indexed and used. Likewise, if you were implementing a script and needed the table to temporarily be loaded, you could do that. This is issued once you are already logged into MySQL at the command line.
- Difficulty:
- Easy
Instructions
-
-
1
Open MySQL in the command line. If you are logged into your server computer, open the Terminal, type "mysql," without the quotation marks, press "Enter" and then log in. If you are accessing the server remotely, log in via the secure shell (SSH) first.
-
2
Type, when "mysql >" is displayed, the following code replacing each "XYZ" with the block you want to load:
LOAD INDEX INTO CACHE XYZ, XYZ
-
3
Press "Enter" to issue the command. You can attach other parameters to the task, for example, to remove leaf nodes add
IGNORE LEAVES;
after the "XYZ" for that table. You have now loaded the index into the cache.
-
1