I’m not sure when this feature got introduced, but I just saw it for the first time recently (and I asked for it when Azure Database for MySQL server was in private preview); but Azure Database for MySQL server can show you the slow queries that are running against the MySQL database. In fact, it’ll log more than just the slow queries, queries that don’t have an index can be logged as well as long-running queries.
If you open the properties of a database in the Azure portal, there’s a couple of different places you can set these settings. The first is on the “Server parameters” blade where you’ll see all the various parameters that you can set for the MySQL deployment. The second is if you select the “Server Logs” option towards the bottom (it’s in the Monitoring section) you’ll see the log files that are being created (if there’s any). At the top of this page, you’ll see a blue bar which says, “Click here to enable logs and configure log parameters.” If you click that it’ll show you a shorter list of the parameters which only includes the settings that are related to the log file (shown in the screenshot).
Once you enable the settings that you need wait a few minutes for there to be load on the system, then go into the “Server Logs” setting of the Azure portal, and you’ll see a log file that you can download. Just open it in notepad (or your favorite text editor), and you’ll see the various log records that you enabled.
While I was playing around with this, I turned on the slow queries option, and I got a bunch of records in the log about queries that WordPress needs to do some tuning on. Since I’m guessing WordPress won’t be doing any database tuning, I’ll have to do it myself. But now that I have some data to work off of, I at least have a starting point.
The post Azure Database for MySQL server has a slow query log now appeared first on SQL Server with Mr. Denny.Contact the Author | Contact DCAC