Slow wp_term_relationships query

Prepare yourself for an unsatisfying answer…

After several days of testing, the conclusion that I’ve come to is that, put simply, this isn’t WordPress’ “fault”. I believe another related issue on the server was putting undue strain on the system. This was simply one of the slower queries, which, since the server was under strain, quickly rose to the top of our slow queries log, with times between 12-16 seconds.

That doesn’t mean that I’m satisfied with the join size of 23,608 (VERY BAD, VERY SLOW). However, it does mean that for others visiting this question, the resolution to your specific problem may be to examine your system as a whole to determine why this (or another) query is performing so poorly.

Happy coding!

Leave a Comment