Last modified: 2014-02-26 11:40:19 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 T35851, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 33851 - ApiQueryArticleFeedback::getUserRatings db queries can be very expensive
ApiQueryArticleFeedback::getUserRatings db queries can be very expensive
Status: RESOLVED WONTFIX
Product: MediaWiki extensions
Classification: Unclassified
ArticleFeedback (Other open bugs)
unspecified
All All
: Normal enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
wikimedia[unmaintained]
: performance
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-01-21 00:56 UTC by Asher Feldman
Modified: 2014-02-26 11:40 UTC (History)
1 user (show)

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


Attachments

Description Asher Feldman 2012-01-21 00:56:51 UTC
I noticed the following query running on an enwiki slave for 10 minutes, before I killed it.  See in the explain:

mysql> explain SELECT /* ApiQueryArticleFeedback::getUserRatings 142.155.15.205 */  aa_rating_id,aa_revision,aa_rating_value  FROM `article_feedback`  WHERE aa_page_id = '30902154' AND aa_rating_id IN ('1','2','3','4')  AND aa_user_id = '0' AND aa_user_text = '142.155.15.205' AND aa_user_anon_token = 'WA5aPep9ImRrfAO4iKJiQkckv1O6fcDG'  ORDER BY aa_revision DESC LIMIT 4;
+----+-------------+------------------+-------+----------------------------------+---------+---------+------+---------+-------------+
| id | select_type | table            | type  | possible_keys                    | key     | key_len | ref  | rows    | Extra       |
+----+-------------+------------------+-------+----------------------------------+---------+---------+------+---------+-------------+
|  1 | SIMPLE      | article_feedback | index | aa_user_page_revision,aa_page_id | PRIMARY | 299     | NULL | 9725137 | Using where |
+----+-------------+------------------+-------+----------------------------------+---------+---------+------+---------+-------------+
1 row in set (0.00 sec)

It would probably be nice if there was an index on aa_user_text, but this query specifies a single aa_page_id and forcing that drops the examined rows lots:

mysql> explain SELECT /* ApiQueryArticleFeedback::getUserRatings 142.155.15.205 */  aa_rating_id,aa_revision,aa_rating_value  FROM `article_feedback` USE INDEX (aa_page_id)  WHERE aa_page_id = '30902154' AND aa_rating_id IN ('1','2','3','4')  AND aa_user_id = '0' AND aa_user_text = '142.155.15.205' AND aa_user_anon_token = 'WA5aPep9ImRrfAO4iKJiQkckv1O6fcDG' ORDER BY aa_revision DESC LIMIT 4;
+----+-------------+------------------+------+---------------+------------+---------+-------+-------+-----------------------------+
| id | select_type | table            | type | possible_keys | key        | key_len | ref   | rows  | Extra                       |
+----+-------------+------------------+------+---------------+------------+---------+-------+-------+-----------------------------+
|  1 | SIMPLE      | article_feedback | ref  | aa_page_id    | aa_page_id | 4       | const | 22936 | Using where; Using filesort |
+----+-------------+------------------+------+---------------+------------+---------+-------+-------+-----------------------------+
1 row in set (0.01 sec)

and the actual query run:

mysql> SELECT /* ApiQueryArticleFeedback::getUserRatings 142.155.15.205 */  aa_rating_id,aa_revision,aa_rating_value  FROM `article_feedback` USE INDEX (aa_page_id)  WHERE aa_page_id = '30902154' AND aa_rating_id IN ('1','2','3','4')  AND aa_user_id = '0' AND aa_user_text = '142.155.15.205' AND aa_user_anon_token = 'WA5aPep9ImRrfAO4iKJiQkckv1O6fcDG' ORDER BY aa_revision DESC LIMIT 4;
Empty set (1.04 sec)
Comment 1 Roan Kattouw 2012-02-08 21:47:37 UTC
I've added an index (and removed an unused one) in r110967, that would fix this issue, right? I've also added it to the list of schema changes in the Etherpad.
Comment 2 Andre Klapper 2014-02-26 11:40:19 UTC
The extension homepage at [[mw:Extension:ArticleFeedback]] says 
"This extension has been archived. This extension has not been maintained in some time, and no longer supports recent releases of MediaWiki.
The following other choices are still available: [[mw:Extension:ArticleFeedbackv5]]"

Furthermore, ArticleFeedback (version 4 or earlier) was removed from all Wikimedia wikis in https://gerrit.wikimedia.org/r/#/c/98074/

It is currently unlikely that there will be any further active development of ArticleFeedback (version 4 or earlier).
Closing this report as WONTFIX to reflect reality.
Please feel free to reopen this report in the future if anyone takes the responsibility for active development of ArticleFeedback (version 4 or earlier) again.

Thank you for reporting this bug and we are sorry it could not be fixed.

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


Navigation
Links