-
Improvement
-
Resolution: Unresolved
-
Minor
-
None
-
3.0.14, 4.0.0-a1, 3.1.12, 3.2.11, 3.3.15
-
None
On very large boards with hundreds of thousands of users or more, pruning inactive users is very difficult, because the user_delete function scans tables via columns that are not used for enumerating data, e.g. message_edit_user in PRIVMSGS_TABLE, and hence have no indexes.
Adding table indexes for the following columns helps avoid full table scans and speeds up mass user deletion by an order of magnitude:
post_edit_user in POSTS_TABLE
message_edit_user in PRIVMSGS_TABLE
user_id in REPORTS_TABLE
user_id in SESSIONS_KEYS_TABLE
This prevents excessive table locking during user pruning, which slows down a board noticeably, regardless of whether it is done manually or by cron. Without these indexes, pruning a few thousand users on a board with more than a million users took several hours. With these indexes, a few minutes at most.

