Currently, the revision table has the usertext_timestamp (rev_user_text,rev_timestamp) index. I was kinda forced to use this for the API's ucuserprefix feature:
SELECT stuff FROM revision LEFT JOIN page ON page_id=rev_page WHERE rev_deleted = 0 AND rev_user_text LIKE '123.456.%' ORDER BY rev_user_text DESC, rev_timestamp DESC
The ORDER BY part is weird, but required to be able to se the usertext_timestamp index. It results in some counterintuitive behavior though: the API sorts contributions by username (Z to A) first, then by timestamp. Sorting the other way around (first by timestamp, then by username) would be more useful and more intuitive, but is currently impossible without killing performance.
I therefore suggest another index be created that sorts the other way, e.g. timestamp_usertext (rev_timestamp, rev_user_text).
Version: 1.13.x
Severity: enhancement