Investigate slow MySQL queries
https://gitlab.com/gitlab-org/gitlab-ce/issues/34680 is one example of a slow MySQL query that seems to have been resolved by changing to MariaDB/upgrading hardware.
Even though we removed subgroup support on MySQL because of the use of PostgreSQL CTEs, it's still not clear why performance is dramatically different.
One explanation in https://dba.stackexchange.com/a/14586 claims that subqueries are not efficient in MySQL. https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/2829 also claims subqueries or UNION queries are not.
I think we need to better understand this since MySQL will still be around for some time.