Hi @Alex,
Welcome to the Microsoft Q&A Platform! Thank you for asking your question here.
As we understand that, you are experiencing an issue where your diagnostic settings are capturing queries that are less than 10 seconds, even though you have changed the long_query_time parameter to 10 seconds. Based on the information provided, let's focus on the second point regarding logging configuration.
The log_queries_not_using_indexes parameter could indeed be causing this issue. When this parameter is enabled, it logs queries that do not use indexes, regardless of their execution time. This means that even if a query takes less than 10 seconds, it will still be logged if it does not use an index.
Here are some steps you can take to address this issue:
- Check the log_queries_not_using_indexes Parameter: Verify if this parameter is enabled. If it is, you can disable it to prevent logging of queries that do not use indexes.
- Review Other Logging Configurations: Ensure that there are no other logging configurations that might be affecting what is being captured. For example, the log_slow_admin_statements parameter logs administrative statements regardless of their execution time.
- Reconnect or Restart the Server: As mentioned in the Q&A Assist response, the change to the long_query_time parameter may not have been applied to existing connections. Reconnecting to the Azure Database for MySQL Flexible Server or restarting the server can help ensure that the new parameter value is applied.
Please refer to the below mentioned link for more information.
https://learn.microsoft.com/en-us/azure/mysql/flexible-server/concepts-monitor-mysql
I hope, This response will address your query and helped you to overcome on your challenges.
If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.