Using index, using temporary, using filesort - how to fix this?
问题 I\'m working on a event tracking system which uses a handful of lookup tables as well as the primary logging table. In a report I\'m writing, an object can be selected to view statistics against. The interface shows all objects in order of decreasing importance (ie, hits). The schema for the two tables (slightly trimmed down, but you get the gist): CREATE TABLE IF NOT EXISTS `event_log` ( `event_id` int(11) NOT NULL AUTO_INCREMENT, `user_id` int(5) DEFAULT NULL, `object_id` int(5) DEFAULT