Skip to content

Enable MySQL slow query log for performance diagnostics - #123

Merged
szachovy merged 2 commits into
masterfrom
fix/76-slow-query-log
Apr 9, 2026
Merged

Enable MySQL slow query log for performance diagnostics#123
szachovy merged 2 commits into
masterfrom
fix/76-slow-query-log

Conversation

@szachovy

@szachovy szachovy commented Apr 8, 2026

Copy link
Copy Markdown
Owner

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.

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 threshold
  • docs/PERFORMANCE.md: Document slow query settings in MySQL table and log location in Monitoring
  • CHANGELOG.md: Add entry

Closes #76

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
szachovy force-pushed the fix/76-slow-query-log branch from 0ced3cb to 4845c19 Compare April 9, 2026 13:55
@szachovy
szachovy merged commit 4b52a3d into master Apr 9, 2026
10 of 11 checks passed
@szachovy
szachovy deleted the fix/76-slow-query-log branch April 9, 2026 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MY-5: Enable slow query log for performance diagnostics

1 participant