Improve performance of ActiveUsersPager query
authorBrad Jorsch <bjorsch@wikimedia.org>
Mon, 9 Jul 2018 19:22:45 +0000 (15:22 -0400)
committerTim Starling <tstarling@wikimedia.org>
Thu, 7 Feb 2019 04:06:13 +0000 (04:06 +0000)
commit262fd585d0e6d7e821461cc7f191c8d2f5644c4c
treec3fa04b9a0d9446693af41fa286546e3b6ff5664
parent42451e649ae51f90e2ef53e181f4b335292f02ff
Improve performance of ActiveUsersPager query

The query can be very slow, as it has to scan all the recentchanges rows
for all the users in querycachetwo (for activeusers). We can speed that
up at the cost of not filtering out users who were active when
querycachetwo was last updated but aren't anymore.

Also in testing this I found that the query is extremely slow when the
actor table migration stage is in one of the transitional states. This
too can be sped up with some custom logic.

Bug: T199044
Change-Id: Ia9d2ff00cfcdcc6191d854eb4365ecbf67f60b1c
RELEASE-NOTES-1.33
includes/specials/pagers/ActiveUsersPager.php