The cache update queries are slow because the indexes are not properly tuned. This has already been discussed and I have explained it here.
Create the following indexes:
CREATE INDEX `test_index_1` ON `qa_posts`(`type`, `acount`, `closedbyid`);
CREATE INDEX `test_index_2` ON `qa_posts`(`type`, `selchildid`, `closedbyid`);
CREATE INDEX `test_index_3` ON `qa_posts`(`type`, `amaxvote`, `closedbyid`);
Try again and report back the results. Currently:
cache_unaqcount: 2347.10 ms
cache_unselqcount: 2699.90 ms
cache_unupaqcount: 2103.15 ms
If you are a purist and don't want those changes you can remove them with:
DROP INDEX `test_index_1` ON `qa_posts`;
DROP INDEX `test_index_2` ON `qa_posts`;
DROP INDEX `test_index_3` ON `qa_posts`;