I spent some time trying to fix query performance with MySQL when building categories list in widget
. I found that its optimizer do not respects table mentions order in
queries when performs
so in some cases it dramaticaly increases query run time. But there is a way to fix it using special MySQL specific
Here is the hack how it can be fixed in Hubzilla code: https://framagit.org/kostikov/core/commit/c71818096187dc84e6b44cf43bd178354b4c9de5
Probably this can be useful in other places if someone is having similar problems.