Improve the rebuild of user activity points
authorAlexander Ebert <ebert@woltlab.com>
Thu, 11 Apr 2024 16:23:38 +0000 (18:23 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Sat, 8 Jun 2024 10:31:07 +0000 (12:31 +0200)
commit929be85930f7ea058c4f5f3daad46b90bf65a731
tree38fe76e8705bd03cd849156e0eabdae24a83a585
parent835adf76b655e2ee90bdd9e30fbdac17444fb6ef
Improve the rebuild of user activity points

The previous implementation relied on `LIMIT … OFFSET …` which has an incredibly poor performance on large data sets. Changing this to `BETWEEN` yields a consistently low latency.

In the previous implementation, up to 92% of the request was spent fetching the target rows.

For a test with 500k records this cut down the time to rebuild from 2:30h down to 20m.
wcfsetup/install/files/lib/system/worker/UserActivityPointItemsRebuildDataWorker.class.php