This blog discusses how to find and address badly written queries using ProxySQL.
All of us are very good in writing good queries. We know this to always be true!
But sometimes a bad query escapes our control and hits our database. There is the new guy, the probie, who just joined the company and is writing all his code using SELECT * instead of WHERE. We’ve told him “STOP” millions of times, but he refuses to listen. Or a there is a new code injection, and it will take developers some time to fix and isolate the part of the code that is sending killing queries to our database.
The above are true stories; things that happen every day in at least few environments.
Isolating the bad query isn’t the main problem: that is something that we can do very fast. The issue is identifying the code that is generating the query, and disabling that code without killing the whole application.
That …
[Read more]