Last modified: 2014-06-23 16:07:13 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T59175, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 57175 - SpecialRecentChanges::doMainQuery query needs tuning
SpecialRecentChanges::doMainQuery query needs tuning
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Database (Other open bugs)
1.21.x
All All
: High major (vote)
: ---
Assigned To: Nobody - You can work on this!
: performance
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-11-18 08:52 UTC by Sean Pringle
Modified: 2014-06-23 16:07 UTC (History)
0 users

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Sean Pringle 2013-11-18 08:52:02 UTC
The following query is much slower on MariaDB enwiki with the FORCE INDEX than without it:

SELECT /* SpecialRecentChanges::doMainQuery */  rc_id,rc_timestamp,rc_cur_time,rc_user,rc_user_text,rc_namespace,rc_title,rc_comment,rc_minor,rc_bot,rc_new,rc_cur_id,rc_this_oldid,rc_last_oldid,rc_type,rc_source,rc_patrolled,rc_ip,rc_old_len,rc_new_len,rc_deleted,rc_logid,rc_log_type,rc_log_action,rc_params,wl_user,wl_notificationtimestamp,ts_tags,fp_stable,fp_pending_since  FROM `recentchanges` FORCE INDEX (rc_timestamp) LEFT JOIN `watchlist` ON (wl_user = '12744321' AND (wl_title=rc_title) AND (wl_namespace=rc_namespace)) LEFT JOIN `tag_summary` ON ((ts_rc_id=rc_id)) LEFT JOIN `flaggedpages` ON ((fp_page_id = rc_cur_id))  WHERE (rc_timestamp >= '20131018000000') AND rc_bot = '0' AND (rc_namespace = '828') AND (rc_type != 5) AND rc_new IN ('0','1')   ORDER BY rc_timestamp DESC LIMIT 500

With force: > 1 minute, a slow range scan on rc_timestamp, ~2 million rows.

Without force: < 3 seconds, a fast ref lookup on rc_namespace_title with cheap filesort, ~1000 rows.
Comment 1 Gerrit Notification Bot 2013-12-10 05:04:34 UTC
Change 100532 had a related patch set uploaded by Springle:
Remove problem forced index. Bug 57175.

https://gerrit.wikimedia.org/r/100532
Comment 2 Gerrit Notification Bot 2013-12-10 05:13:11 UTC
Change 100532 merged by jenkins-bot:
Remove problem forced index. Bug 57175.

https://gerrit.wikimedia.org/r/100532

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links