Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4033134
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T11:48:33+00:00 2026-05-20T11:48:33+00:00

The MySQL documentation implies that you can assign one or more of a table’s

  • 0

The MySQL documentation implies that you can assign one or more of a table’s indexes to a named key buffer (and preload them). The syntax definition in the manual is:

CACHE INDEX
  tbl_index_list [, tbl_index_list] ...
  IN key_cache_name

tbl_index_list:
  tbl_name [[INDEX|KEY] (index_name[, index_name] ...)]

which seems to say that you could assign just one of a table’s indexes to the named key buffer. For example:

SET GLOBAL my_keys.key_buffer_size=512*1048576;
CACHE INDEX my_table KEY (PRIMARY) INTO my_keys;
LOAD INDEX INTO CACHE my_table KEY (PRIMARY);

would load only the PRIMARY index of my_table.

But from what I can tell, it doesn’t work like that, at least, not in 5.0.87. Instead, the server appears to load all the table’s indexes, effectively ignoring the index list part in parenthesis.

For example, I have a big dictionary table:

CREATE TABLE dict (
  id INT NOT NULL PRIMARY KEY,
  name VARCHAR(330) NOT NULL,
  UNIQUE KEY (name) );

Now, if I attempt to load just the PRIMARY index, the mysqld’s resident size in memory increases by the size of dict.MYI (733 MB in my example) which is buch bigger than the size of the PRIMARY index alone (103 MB).


UPDATE 2011-01-08: The documentation for CACHE INDEX actually provides the answer:

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

If I would have properly read the very documentation I referenced in the OP, none of this would ever have happened.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T11:48:34+00:00Added an answer on May 20, 2026 at 11:48 am

    fsb’s answer to his own question for those who missed the update.

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

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The MySQL documentation states that when using INSERT ... ON DUPLICATE KEY UPDATE, the
I can read the MySQL documentation and it's pretty clear. But, how does one
I am lost in MySQL documentation. I have a table with votes - it
Another developer tells me that there is a MySQL ConnectorJ option which can be
I learned today through this section of the MySQL documentation that prepared statements cannot
The MySQL documentation says that it should be \' . However, both scite and
I have been playing around with indexes on MySQL (5.5.24, WinXP), but I can't
I have been checking the MySQL Documentation for ALTER TABLE and it does not
According to the MySQL documentation: As a general rule, you should never assign a
MySQL documentation says that since 5.0, varchar lengths refer to character units, not bytes.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.