[MDEV-29216] Log Queries without Indexes - Ignore those where just the "wrapping" SELECT doesn't use index Created: 2022-07-30 Updated: 2022-08-01 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Server |
| Fix Version/s: | None |
| Type: | Task | Priority: | Minor |
| Reporter: | Nuno | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | slow_query_log | ||
| Attachments: |
|
| Description |
|
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. |