|Applicable To||MySQL Server|
|Server Startup Option|| |
|Category||Performance, Monitoring, Best Practices|
If you have slow query logs enabled (with
--log-slow-queries), this variable will help interpret all those queries that are not using indexes as slow queries.
While designing a MySQL oriented application, I generally design my schema first without introducing any index (only exception being the PRIMARY ones). Get the application ready. Next enable
log_queries_not_using_indexes and start index usage testing. Analyze all queries, introduce indexes one by one and you are all set to go. This helps a lot in rewriting queries, figuring out the best possible index etc. Many times I have seen the need for swapping WHERE clause CONDITIONS for making it possible for the query to use an existing index.
For already deployed systems' performance glitches and production outages, this flag do serve as a starting point.
Though as always, usage of a variable is subject to circumstances. For my conditions and usage pattern, this variable comes very handy.
Hope you enjoyed reading this.