Extreme slowness of 5/2/2023

GasBandit

Staff member
So how many GB was it, GB?
None, actually. It was a MySQL problem I created by pruning 6,600+ spam accounts from our user table.

Did you know that when you delete a user, it instigates a cleanup of several different unindexed tables, resulting in tying up the MySQL connection for about 40 seconds per user deleted?

I didn't.

Until after the batch delete.

So the slowness would have persisted for about 72 hours and change to work out on its own. Instead, it lasted about 3 hours because that's how long it took me to figure out where the problem was, research it, find a solution, and implement it.

Those 40 second table cleanups now take about 0.15 seconds, because I manually created indexes for the tables in question.
 
I might not know a whole lot about SQL, but I still think a better question would be-why would anyone want to create a table to store stuff, but then not index it?

—Patrick
 
Last edited:

GasBandit

Staff member
A better question would be-why would anyone want to create a table to store stuff, but then not index it?

—Patrick
It came about as sort of a culmination of tech debt, I think. The tables in question were for functions that didn't get added in until later (like reacting to posts), and even then, you'd only notice it if you went to delete many users at once.

It was fixed in XenForo v2.2 - which we don't have because our license ran out forever ago. But for our purposes, just creating the indexes is all that really needed to be done.
 
Top