What can cause a MEMORY table (which I understood to be very fast) to regularly update slowly with queries similar to:
UPDATE aliro_session SET time = '1268959445', marker = marker+1 WHERE session_id = '9215b8263dd679e2ffd78a39a8253e18' AND isadmin = 0 AND time > 1268958545
The field session_id is the primary key, so finding the record should be simple. And none of the fields in the table is too complicated:
CREATE TABLE IF NOT EXISTS `aliro_session` ( `time` int(11) NOT NULL default '0', `session_id` char(32) NOT NULL, `isadmin` tinyint(3) unsigned NOT NULL default '0', `guest` tinyint(4) NOT NULL default '1', `userid` int(11) NOT NULL default '0', `gid` tinyint(3) unsigned NOT NULL default '0', `marker` smallint(6) NOT NULL default '0', `ipaddress` varchar(15) NOT NULL, KEY `session_id` USING HASH (`session_id`)) ENGINE=MEMORY DEFAULT CHARSET=utf8;
Is there some reason why this would regularly crop up as a slow-ish query?
UPDATE aliro_session SET time = '1268959445', marker = marker+1 WHERE session_id = '9215b8263dd679e2ffd78a39a8253e18' AND isadmin = 0 AND time > 1268958545
The field session_id is the primary key, so finding the record should be simple. And none of the fields in the table is too complicated:
CREATE TABLE IF NOT EXISTS `aliro_session` ( `time` int(11) NOT NULL default '0', `session_id` char(32) NOT NULL, `isadmin` tinyint(3) unsigned NOT NULL default '0', `guest` tinyint(4) NOT NULL default '1', `userid` int(11) NOT NULL default '0', `gid` tinyint(3) unsigned NOT NULL default '0', `marker` smallint(6) NOT NULL default '0', `ipaddress` varchar(15) NOT NULL, KEY `session_id` USING HASH (`session_id`)) ENGINE=MEMORY DEFAULT CHARSET=utf8;
Is there some reason why this would regularly crop up as a slow-ish query?
Comment