Last modified: 2011-04-10 23:44:02 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.
tracking to bug 22744, maybe someone has time to look at the indices.
Indexes are fine query wise, and it's also done in core. Fixed in r85771
(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.
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