https://bugzilla.wikimedia.org/show_bug.cgi?id=53577

       Web browser: ---
            Bug ID: 53577
           Summary: IndexPager::buildQueryInfo (LogPager) query needs
                    tuning
           Product: MediaWiki
           Version: 1.21.1
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: Unprioritized
         Component: Database
          Assignee: [email protected]
          Reporter: [email protected]
    Classification: Unclassified
   Mobile Platform: ---

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.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to