Hey there,

So in the interest of cleaning and optimizing a large perl/mysql system I inheirited from a prior developer, I need to find a way to log unindexed queries. Slow queries are easy to identify, but unindexed ones are not (unless, of course, they're slow enough to make the slow log). A full query log is out of the question due to the high traffic on the system... and the slow log isn't enough as I have a suspicion some quick-but-not-quick-enough unindexed queries run several times a minute (or more) are having a serious degrading effect on the system overall.

Can anyone tell me if there is a way to customize which queries get logged, or at least set the system to throw a flag to the error log when it hits an unindexed query? I know with more recent MySQL installations, you can force the query optimizer not to run unindexed queries, however this is not an option for the production site.

Anyway, any insight into some MySQL monitoring or custom logging working towards optimization of queries would be appreciated - really need to get this system running more smoothly before we try to scale it out to double or quadruple the user base, and hand-sifting through every possible query just isn't an option...

thanks for your attention
barry