If I’m correct, your server just updated its MariaDB version didn’t it? I think there might be a regression in this version with a particular query that is used by the phrase system here (which has a very large list of phrase names in an IN clause).
I’m not sure if it’s possible to temporarily roll back the MariaDB change, to help confirm this. I did workaround this for another customer a recently, though at the time it appeared to be server-specific. We will likely need to change our approach for now, but if this is a performance regression in MariaDB, we will likely need to gather a reduced test case to report to them.
I’m going to move this to bugs for now. If you’re stuck with this and can’t/aren’t comfortable with server changes, let me know and I’ll see if I can pull a quick and dirty fix.