Recently I was troubleshooting some inefficiencies with the jobs systems locking and fetching queries at work. Like a good little boy I, originally, came up with one index which satisfied all the queries that I needed to run against this particular critical table. (`completed`,`heartbeat`,`priority`,`datacenter`,`worker`) — datetime,datetime,tinyint,varchar(16),varchar(255) the query looked like this: SELECT `id`,GET_LOCK(CONCAT(‘foo_’,`id`),0) as mylock [...]
-
Home > Archives for June, 2009