Last modified: 2011-04-10 23:44:02 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 T30455, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 28455 - Add 'toponly' to recentchanges API module
Add 'toponly' to recentchanges API module
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
API (Other open bugs)
1.18.x
All All
: Normal enhancement (vote)
: ---
Assigned To: Roan Kattouw
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-04-07 07:58 UTC by Krinkle
Modified: 2011-04-10 23:44 UTC (History)
6 users (show)

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


Attachments

Description Krinkle 2011-04-07 07:58:38 UTC
Having it in usercontribs (bug 4597, bug 26873) is nice, but for fighting vandalism it would be very useful to have in the recentchanges module as well.

Not sure how friendly this is with effeciency (indexes), but if it's not a problem I think this is a good idea to implement.
Comment 1 db [inactive,noenotif] 2011-04-09 09:08:38 UTC
tracking to bug 22744, maybe someone has time to look at the indices.
Comment 2 Sam Reed (reedy) 2011-04-10 21:42:40 UTC
Indexes are fine query wise, and it's also done in core.

Fixed in r85771
Comment 3 Bawolff (Brian Wolff) 2011-04-10 23:36:27 UTC
(In reply to comment #2)
> Indexes are fine query wise, and it's also done in core.
> 
> Fixed in r85771

Well the queries aren't exactly great in some cases - aka http://en.wikipedia.org/w/index.php?title=Special:Contributions&dir=prev&limit=500&contribs=user&target=SmackBot&topOnly=1 isn't good.
Comment 4 Sam Reed (reedy) 2011-04-10 23:44:02 UTC
http://192.168.0.190/w/api.php?action=query&list=usercontribs&ucuser=Reedy

mysql> EXPLAIN SELECT /* ApiQueryContributions::execute Reedy */  rev_timestamp,page_namespace,page_title,rev_user,rev_user_text,rev_deleted,rev_page,rev_id,page_latest,rev_comment,rev_len,rev_minor_edit,rev_parent_id  FROM `mw_page`,`mw_revision` FORCE INDEX (usertext_timestamp)   WHERE (page_id=rev_page) AND ((rev_deleted & 4) = 0) AND rev_user_text = 'Reedy'  ORDER BY rev_timestamp DESC LIMIT 11;
+----+-------------+-------------+--------+--------------------+--------------------+---------+-----------------------------+------+-------------+
| id | select_type | table       | type   | possible_keys      | key                | key_len | ref                         | rows | Extra       |
+----+-------------+-------------+--------+--------------------+--------------------+---------+-----------------------------+------+-------------+
|  1 | SIMPLE      | mw_revision | ref    | usertext_timestamp | usertext_timestamp | 257     | const                       |   26 | Using where |
|  1 | SIMPLE      | mw_page     | eq_ref | PRIMARY            | PRIMARY            | 4       | wikidb.mw_revision.rev_page |    1 |             |
+----+-------------+-------------+--------+--------------------+--------------------+---------+-----------------------------+------+-------------+
2 rows in set (0.00 sec)


http://192.168.0.190/w/api.php?action=query&list=usercontribs&ucuser=Reedy&uctoponly

mysql> EXPLAIN SELECT /* ApiQueryContributions::execute Reedy */  rev_timestamp,page_namespace,page_title,rev_user,rev_user_text,rev_deleted,rev_page,rev_id,page_latest,rev_comment,rev_len,rev_minor_edit,rev_parent_id  FROM `mw_page`,`mw_revision` FORCE INDEX (usertext_timestamp)   WHERE (page_id=rev_page) AND ((rev_deleted & 4) = 0) AND rev_user_text = 'Reedy' AND (rev_id = page_latest)  ORDER BY rev_timestamp DESC LIMIT 11
    -> ;
+----+-------------+-------------+--------+--------------------+--------------------+---------+-----------------------------+------+-------------+
| id | select_type | table       | type   | possible_keys      | key                | key_len | ref                         | rows | Extra       |
+----+-------------+-------------+--------+--------------------+--------------------+---------+-----------------------------+------+-------------+
|  1 | SIMPLE      | mw_revision | ref    | usertext_timestamp | usertext_timestamp | 257     | const                       |   26 | Using where |
|  1 | SIMPLE      | mw_page     | eq_ref | PRIMARY            | PRIMARY            | 4       | wikidb.mw_revision.rev_page |    1 | Using where |
+----+-------------+-------------+--------+--------------------+--------------------+---------+-----------------------------+------+-------------+
2 rows in set (0.00 sec)


http://192.168.0.190/w/api.php?action=query&list=usercontribs&ucuser=Reedy&uctoponly&ucdir=newer

mysql> EXPLAIN  SELECT /* ApiQueryContributions::execute Reedy */  rev_timestamp,page_namespace,page_title,rev_user,rev_user_text,rev_deleted,rev_page,rev_id,page_latest,rev_comment,rev_len,rev_minor_edit,rev_parent_id  FROM `mw_page`,`mw_revision` FORCE INDEX (usertext_timestamp)   WHERE (page_id=rev_page) AND ((rev_deleted & 4) = 0) AND rev_user_text = 'Reedy' AND (rev_id = page_latest)  ORDER BY rev_timestamp LIMIT 11
    -> ;
+----+-------------+-------------+--------+--------------------+--------------------+---------+-----------------------------+------+-------------+
| id | select_type | table       | type   | possible_keys      | key                | key_len | ref                         | rows | Extra       |
+----+-------------+-------------+--------+--------------------+--------------------+---------+-----------------------------+------+-------------+
|  1 | SIMPLE      | mw_revision | ref    | usertext_timestamp | usertext_timestamp | 257     | const                       |   26 | Using where |
|  1 | SIMPLE      | mw_page     | eq_ref | PRIMARY            | PRIMARY            | 4       | wikidb.mw_revision.rev_page |    1 | Using where |
+----+-------------+-------------+--------+--------------------+--------------------+---------+-----------------------------+------+-------------+
2 rows in set (0.00 sec)



On a limited set it's ok... Slow queries are slow

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


Navigation
Links