I think we should adopt a principle similar to KeptPages for RC logs, that is, to maintain a consistent log for 14 days or so, no matter how many entries happen in those days, instead of just saying "the last 5000 changes". So I guess we should just DELETE FROM the RecentChanges table all entries that are older than n days regularly.
Either should be fine, but keeping it at a constant 5000 should make it faster. I created the table originally in an attempt to speed up the RC page, and also to generate the new formats, which gathered multiple changes to the same page. Alas, no matter how many methods I tried for that, none of them had acceptable performance, so I stepped back to think about it for a while, and never got around to actually using the table even for the present RC format. It should be simple to do that; I'll test Magnus's fix and install it if all is well.
wikitech-l@lists.wikimedia.org