Recentchanges Inaccurate Byte Diff
On the Recentchanges and Contributions pages, for each revision there is a +- number that gives the number of characters that were added or removed since the preceding revision. The current method of attempting to group the table rows with a lower table row is convoluted, takes multiple queries, and inefficient.
Not only that, but for new pages, it shows the number of bytes that are different from whatever the previous revision in the database is.
Was able to speed up these pages a bit by adding another field to the revision table (lastrevisionid). For each revision, the previous revision is linked to the row on this field. This means we can skip ordering and grouping because we have the ID, and we can avoid a second query, and avoid 2 more loops. All-in-all, this makes things more efficient and correct.
Fixed for the next build. However, even with these changes, these queries are still slow. When compared to the vault_link table queries, I cannot see why, considering those use larger tables with less specific criteria with just as many joins.