Author: bugzilla_wikipedia_org.to.jamesd
Description:
After seeing a large number of queries for all records in ipblocks with order
ipb_timestamp desc I today added the index ipb_timestamp (ipb_timestamp desc) to
all databases on the Wikimedia servers. This changes the query from one using no
index and a filesort to get the order to one using the new index. The queries
were happening for both 1.4 and pre-1.4 projects. Block::enumBans is the query
comment on the 1.4 wikis. Seems likely to be of assistance for other mediawiki
users.
In addition, the ipblocks in 1.4 showed a FOR UPDATE query which wanted every
record in the table. Is it really necessary to get an exclusive read and write
lock on the whole table? Maybe do it in ipb_address like '1%' then like '2%' and
so on to like '9%' chunks, so most lock checks can continue while some are being
updated? Perhaps only after a check without for update shows more than 50 blocks
total?
Version: 1.4.x
Severity: normal