MessageCache: Add STRAIGHT_JOIN to avoid planner oddness
authorBrad Jorsch <bjorsch@wikimedia.org>
Mon, 26 Aug 2019 19:12:30 +0000 (15:12 -0400)
committerBrad Jorsch <bjorsch@wikimedia.org>
Mon, 26 Aug 2019 19:12:30 +0000 (15:12 -0400)
commit9e871e05b7392ce6cd1f6acbecbbf09b90f590b7
treef32c44700f6dc923e39126025aeb9d0fef02b44d
parent03d2f3006048bc404b40b02838bd9fb9b563cced
MessageCache: Add STRAIGHT_JOIN to avoid planner oddness

For some unknown reason, when the `actor` table has few enough NS8 rows
compared to `page` MariaDB 10.1.37 decides it makes more sense to fetch
everything from `actor` then join `revision` then `page` rather than
fetching the rows from `page` in the first place.

We can work around it by telling it to not reorder the query, but then
we also have to reorder it ourselves to put `page` first instead of
`revision`.

Bug: T231196
Change-Id: I2b2fb209e648d1e407c5c2d32d3ac9e574e361d5
includes/cache/MessageCache.php