MySQL Forums
Forum List  »  Performance

Re: Queries slow down daily, optimizing helps -> why?
Posted by: aftab khan
Date: February 26, 2009 09:56AM

your query requires an index scan, which pushes out of the cache all the index blocks corresponding to valuable high-level B-tree nodes. thats why you observe slow and fast behavior.

try

SET GLOBAL key_cache_division_limit=25;

if possible use different cache for these tables...

mysql> SET GLOBAL hot_cache.key_buffer_size=128*1024;
Query OK, 0 rows affected (0.00 sec)

mysql> CACHE INDEX `person` , `user` IN hot_cache;
+-------------+--------------------+----------+----------+
| Table | Op | Msg_type | Msg_text |
+-------------+--------------------+----------+----------+
| test.person | assign_to_keycache | status | OK |
| test.user | assign_to_keycache | status | OK |
+-------------+--------------------+----------+----------+
2 rows in set (0.00 sec)

mysql> SET GLOBAL hot_cache.key_buffer_size=128*1024*1024;
Query OK, 0 rows affected (0.00 sec)

mysql> CACHE INDEX `person` , `user` IN hot_cache;
+-------------+--------------------+----------+----------+
| Table | Op | Msg_type | Msg_text |
+-------------+--------------------+----------+----------+
| test.person | assign_to_keycache | status | OK |
| test.user | assign_to_keycache | status | OK |
+-------------+--------------------+----------+----------+
2 rows in set (0.00 sec)

mysql> LOAD INDEX INTO CACHE `person` , `user` IGNORE LEAVES;
+-------------+--------------+----------+----------+
| Table | Op | Msg_type | Msg_text |
+-------------+--------------+----------+----------+
| test.person | preload_keys | status | OK |
| test.user | preload_keys | status | OK |
+-------------+--------------+----------+----------+
2 rows in set (0.00 sec)

Options: ReplyQuote


Subject
Views
Written By
Posted
2201
March 18, 2009 03:58AM
Re: Queries slow down daily, optimizing helps -> why?
2102
February 26, 2009 09:56AM


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.