MySQL and MariaDB is a free and open source database server for Windows, Linux and Unix-like system. Your web app can be slow due to way too many queries or poorly written SQL queries. This quick tutorial explains how to speed up your MySQL/MariaDB queries 300 times on Linux or Unix-like server.
From the blog:
Before you can profile slow queries, you need to find them.
MySQL has a built-in slow query log. To use it, open the my.cnf file and set the slow_query_log variable to “On.” Set long_query_time to the number of seconds that a query should take to be considered slow, say 0.2. Set slow_query_log_file to the path where you want to save the file. Then run your code and any query above the specified threshold will be added to that file.
- Read more: How to speed up your MySQL queries 300 times