Note: This is written for mysql version 5.5. Old mysql version has slightly different syntax.
Mysql can log slow queries which takes longer to execute. In some cases this is expected but some queries take longer because of coding mistakes. slow-query-log can definitely help you find those queries and make it easy to debug your application.
In WordPress world, many plugins are often coded my amateurs who have no idea about the scale at which big sites operate! Its better to use slow-query-log to find out such plugins.
You can enable slow-log by un-commenting following lines in
/etc/mysql/my.cnf. If you’re using EE4, the location of mysql config file is mentioned in it’s documentation.