MySQL Forums
Forum List  »  Performance

Re: Queries very slow until key cache fills up. Is there a way around this?
Posted by: Harrison Fisk
Date: December 02, 2004 07:57PM

Hi,

You can do a query to "warm" the cache. Any query that does a full index scan should get the keycache populated with a lot of the index. An example that would load an index on id would be something like:

SELECT sum(ID) FROM tbl;

To verify, look for a type of "index" in the EXPLAIN using the index you want to load.

If you want this to occur at system startup, then you can look at using the --init-file option for mysqld. That will allow the above query to execute at server start and load it then.

Harrison Fisk, Trainer and Consultant
MySQL AB, www.mysql.com

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Queries very slow until key cache fills up. Is there a way around this?
2172
December 02, 2004 07:57PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.