Enable MySQL slow query log for performance diagnostics - #123
Merged
Conversation
Add slow_query_log=ON, long_query_time=10, log_queries_not_using_indexes=ON to capture queries exceeding 10 seconds or performing full table scans. Use 10s threshold (MySQL default) instead of 2s to avoid flooding the slow log with normal BI analytical queries that routinely take several seconds (dashboard aggregations, SQL Lab explorations). Update PERFORMANCE.md with slow query settings and log file location. Closes #76 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
szachovy
force-pushed
the
fix/76-slow-query-log
branch
from
April 9, 2026 13:55
0ced3cb to
4845c19
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add
slow_query_log=ON,long_query_time=10,log_queries_not_using_indexes=ONto capture queries exceeding 10 seconds or performing full table scans.Why 10s instead of 2s
The 2s threshold from the original issue is too aggressive for a BI workload. Superset dashboard aggregations, SQL Lab explorations, and multi-chart renders routinely produce queries taking 3–8 seconds. A 2s threshold would flood the slow log with normal analytical traffic, making it useless for spotting real problems.
10 seconds is MySQL's own default — proven across decades of production use. Combined with
log_queries_not_using_indexes=ON(which catches full-scan queries regardless of duration), this provides useful diagnostics without noise.Changes
services/mysql-server/mysql_config.cnf.tpl: Add slow query log settings with 10s thresholddocs/PERFORMANCE.md: Document slow query settings in MySQL table and log location in MonitoringCHANGELOG.md: Add entryCloses #76