Add STRAIGHT_JOIN to ApiQueryLogEvents and LogPager to avoid planner oddness
authorBrad Jorsch <bjorsch@wikimedia.org>
Tue, 16 Apr 2019 17:45:32 +0000 (13:45 -0400)
committerBrad Jorsch <bjorsch@wikimedia.org>
Tue, 23 Apr 2019 14:00:21 +0000 (10:00 -0400)
commit3d1fb0c0443ee92531ca8e1aafbcf9b403879e44
treea73aafe8e31743b7a6bc941c1d3ffd2faf50494b
parent3144a37e05b66e31893a369de7fd4bb651d73a11
Add STRAIGHT_JOIN to ApiQueryLogEvents and LogPager to avoid planner oddness

For some unknown reason, when the `actor` table has few enough rows (or
few enough compared to `logging`) MariaDB 10.1.37 decides it makes more
sense to fetch everything from `actor` + `logging` and filesort rather than
fetching the limited number of rows from `logging`.

We can work around it by telling it to not reorder the query.

Bug: T220999
Bug: T221458
Change-Id: I9da981c09f18ba72efeeb8279aad99eb21af699a
includes/api/ApiQueryLogEvents.php
includes/logging/LogPager.php