Have seen multiple instances of this one backing up on commonswiki slaves recently:
SELECT /* IndexPager::buildQueryInfo (LogPager) 148.160.132.46 */ log_id,log_type,log_action,log_timestamp,log_user,log_user_text,log_namespace,log_title,log_comment,log_params,log_deleted,user_id,user_name,user_editcount,ts_tags FROM logging FORCE INDEX (times) LEFT JOIN user ON ((log_user=user_id)) LEFT JOIN tag_summary ON ((ts_log_id=log_id)) WHERE (log_action != 'revision') AND (log_type != 'suppress') AND log_type IN ('delete','move') AND log_namespace = '0' AND log_title = '0' AND ((log_deleted & 1) = 0) ORDER BY log_timestamp DESC LIMIT 11
It runs in excess of 10 minutes.
EXPLAIN says the FORCE INDEX sends MySQL onto a very slow index scan over times (log_timestamp) which is hardly better than a table scan in this case.
Removing the FORCE allows page_time index be used which reduces execution time to a few seconds.
Suggest either filtering by a range on log_timestamp or removing the FORCE.
Version: 1.23.0
Severity: normal
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=54122