Consider queries like these:
(SELECT ...) UNION ALL (SELECT ...) UNION ALL (SELECT ...) ORDER BY ... DESC
SELECT * FROM (SELECT ...) AS `t` ORDER BY ... ASC
And something more complex, like a mix of the above:
All these queries are logged when I have not_using_index in log_slow_filter.
I believe these queries are optimized as they can be, and I can't really make those "wrapping SELECTs" use indexes. (except, I believe, if I put the results in temporary tables with indexes, which seems overkill to me)
Having these appearing in the Slow Log creates a lot of noise that doesn't let me focus on other queries that really need to be fixed.
I wonder if it would make sense to add an extra filter so that these "false positives" are not included, what do you think?
Something like "not_using_index_notderived" or "not_using_index_realtables" (just random suggestions)
Thank you very much.