inflearn logo

MySQL Slow Query Tuning Automation — From Collection to AI Diagnostics, Real-World Validation, and Recurrence Tracking

After learning SQL tuning, automate recurring tuning tasks. This hands-on project connects everything from collecting MySQL queries to AI diagnosis, empirical validation, handoff to the person in charge, and tracking recurrence.

5 learners are taking this course

Level Intermediate

Course period Unlimited

Python
Python
SQL
SQL
AWS
AWS
MySQL
MySQL
grafana
grafana
Python
Python
SQL
SQL
AWS
AWS
MySQL
MySQL
grafana
grafana

What you will gain after the course

  • Create a query priority table based on total load and execution count, and record the reasons for accepting, rejecting, or deferring AI suggestions.

  • Connects on-site verification, handoff to the person in charge, improvement, and recurrence tracking, and completes a post-action performance report.

🎁 Year-End Coupon — 25% off through December 24 (first 50 only) · Get the coupon
The coupon must be used within 24 hours of receiving it.

MySQL Query Tuning Automation: From AI Diagnosis to Recurrence Tracking

After learning SQL tuning, automate repetitive tuning response tasks. This hands-on project connects the entire workflow, from collecting MySQL queries to AI diagnosis, real-world performance validation, handoff to the person responsible, and recurrence tracking.

From collection through recurrence tracking, all in one workflow.

Query collection → AI diagnosis → real-world validation → ticket assignment → resolution and recurrence tracking

  • Collection: Store snapshot differences in cumulative performance_schema values, then prioritize actions based on execution count and total load.

  • Diagnosis: Review execution plans and improvement suggestions using read-only evidence tools and Claude Code.

  • Validation: Measure result consistency and performance before and after a single ADD INDEX operation in a separate database, then revert the index.

  • Handoff: Link the CMDB owner information with existing tickets to prevent duplicate issuance.

  • Traceability: Record post-resolution observations and recurrence status in Grafana reports and work logs.

We do not automatically apply indexes to the production DB. We document the validation results and change plan, and actual production changes undergo human approval and review.

Four deliverables completed after taking the course

  • Query priority table: Compare average execution time, frequency, and total load, and explain the priority targets and reasons for exclusion.

  • AI Recommendation Validation Record: Verify result equivalence, execution plans, before-and-after measurements, and rollback conditions, then document the rationale for accepting, rejecting, or deferring the recommendation.

  • Owner request form: Link the target cluster, query fingerprint, responsible team, and existing ticket.

  • Post-implementation performance report: Record whether it was actually applied, the observation conditions and sample, improvements, regressions, and recurrence, as well as next steps.

Getting Started + 10 Learning Sections, 11 Sections in Total

  1. Getting started · Learning materials and practice path: Check the learning sequence and scope of validation.

  2. Set up measurement criteria and the practice environment: Distinguish between average time, execution count, and total load.

  3. Execution plans, indexes, and query tuning decisions: Read execution plans and practice improving indexes and queries.

  4. Collection, detection, and CMDB integration: Configure snapshots and detection rules, and distinguish collection gaps from cases that were not actually executed.

  5. Claude Code diagnosis and empirical validation: Review AI suggestions and measure their effectiveness in a separate database.

  6. Owners, tickets, resolution, and recurrence tracking: Link duplicate prevention with resolution and recurrence status.

  7. Grafana, performance tracking, and operational changes: Visualize monitoring results and record implementation details and outcomes.

  8. Comprehensive assessment project and AWS expansion: Complete a comprehensive project and explore cloud expansion paths.

88 lessons · 9 hours and 24 minutes of video. In addition to watching the videos, you’ll need time to set up the environment and complete hands-on exercises and assignments.

Supplementary section (Sections 9–11) — 22 real-world incidents, about 17–19 minutes per lesson. Follow a single slow-query incident all the way through collection → diagnosis → proposed fix → measured verification → recurrence monitoring, without skipping a step. We demonstrate, using output from actually running everything on My PC with MySQL 8.0, cases including load missed by the slow log, misdiagnosed lock waits, digest table overflow and fingerprint splitting, log explosions from sample collection, missed masking, full scans caused by type conversions, sorting and counting rows on admin screens, query rewriting, outdated hints, NOT IN with NULL, full-table retrieval with OFFSET, bulk deletes, temporary tables for analytical queries, validating AI-suggested indexes and query rewrites, the illusion of cold-cache measurements, new queries after deployment, index cleanup, execution-plan regression monitoring, and a comprehensive mock incident. Ready-to-use check SQL, scripts, and checklists for each lesson are included in the supplementary practice ZIP (lesson attachments 08-01 and 10-07).

Practice validation and post-incident judgment through 9 scenarios.

It covers cases involving changed results, gaps in data collection, no execution, unused indexes, environmental changes, withdrawals, improvements, deterioration, and non-application. Synthetic cases, answer templates, explanations, and assessment rubrics show what additional evidence is needed.

Automated grading checks whether the required items match the decision codes. The quality of the explanations is reviewed separately using a rubric, and passing the assignment does not mean you are certified or that operational changes have been approved.

Preview an actual lesson before purchasing.

You can preview the lessons “01-01 Course Introduction” (4 minutes 57 seconds) and “08-01,” “09-01,” “10-01,” and “10-05” in the curriculum below.

About one-third or more (35–44%) of the lesson footage in the supplementary episode consists of actual terminal window captures.

A separate promotional video, approximately 1 minute and 41 seconds long, includes about 90 seconds of actual class excerpts. The promotional video and the free class preview are separate videos.

The course uses a locally generated AI male voiceover. The full course includes optional Korean subtitles, a separate SRT file, and a script, so please check the explanation pace and pronunciation in the preview.

The video was made with slides and a synthesized voice (TTS), and the numbers and results shown on screen were taken from actual execution output.

Recommended for

  • Backend developers looking to read SELECTs and JOINs and automate responses to recurring slow queries.

  • DBAs, SREs, and platform engineers looking to connect diagnosis, handoffs, and post-deployment monitoring.

  • Technical leads who want to determine whether to adopt AI suggestions based on evidence and real-world measurements

Basic knowledge of SQL and indexes, terminal commands, and Python virtual environments is required. For an introduction to SQL syntax and preparation for the SQLP exam, a separate foundational course is recommended.

Practice Environment and Additional Costs

  • Account-free decision-making task: Get started with Python 3.10 or later and an editor. Use only the Python standard library; no external APIs or cloud accounts are required.

  • Local MySQL exercises: Docker or a separate MySQL environment and Python are required. Since 2 million synthetic order rows are used, please prepare sufficient memory, disk space, and ports. Execution time and plans vary depending on the environment.

  • Run a new AI diagnostic: Claude Code authentication and a read-only practice tool are required, and service usage fees are charged separately. You can also learn from the recorded results.

  • AWS extension lab: Requires Terraform/CLI, an approved AWS account, permission to delete resources, and model access; deployment incurs additional charges.

Provided materials and supplemental AWS resources

Includes 88 lessons and 9 hours and 24 minutes of video, SRT files and transcripts, workbooks, knowledge-check questions, synthetic assignments and solutions, a decision-making rubric, four types of work-log templates, and installation, verification, and deletion instructions.

We also provide AWS supplemental materials that verify collection and detection, internal tickets, Bedrock diagnostics, adding and removing validation indexes, and resolution and recurrence tracking in a separate synthetic RDS environment. See the public AWS supplemental materials and documentation for execution records, tests, and verification scope by specification.

Full redeployment and measurement of the latest minimum specifications, actual Jira and Slack transmissions, long-term recovery, and migration to an existing production database are subject to separate verification. Execution results and AI responses may vary by environment. Model weights, company operational data, and authentication credentials are not included in the provided materials.

Questions Before Purchase

Does the AI automatically apply indexes to the production database?
No. Changes are verified and rolled back in a separate validation database. The AWS apply-plan creates a change plan, while actual production changes undergo human approval and review.

Can I get started without an AI account?
Yes. You can start with recorded results and account-free synthetic decision-making tasks. Separate authentication and costs are required to run new AI diagnostics or AWS deployments.

Do I need to achieve the same performance as in the example?
It varies depending on the data distribution, statistics, optimizer, and execution environment. You will learn how to compare result consistency, execution plans, and before-and-after measurement evidence under identical conditions.

How are questions answered and updates provided?
Access to the course is unlimited. For six months after purchase, we support questions and answers about the course content and provided examples, and respond within seven days of receiving a question. We will fix any course or exercise errors identified during the six months following release. Individual tuning of a company's operational database, deployment services, and integration with individual systems are not included in the scope of support.

Introducing your instructor, Data Artisan

I am a data expert with over 20 years of experience in databases and IT. I have worked as a DBA and DB Platform team manager in the gaming, finance, and IT services industries, handling SQL tuning and database platforms. I created this course to connect the collection, diagnosis, validation, handoff to the responsible person, and follow-up tracking of recurring query issues. I also share practical automation workflows and criteria for validating AI recommendations.

Recommended for
these people

Who is this course right for?

  • A backend developer who can read SQL and wants to automate recurring query tuning requests

  • DBAs, SREs, and platform engineers looking to validate AI recommendations and connect owners, tickets, and improvement tracking

Need to know before starting?

  • Basic SQL SELECT, JOIN, and WHERE and Index Concepts

  • Ability to read Python code and terminal commands. Local practice requires Docker, while AWS expansion requires a separate account and incurs costs.

Hello
This is dorian05202988

Career Verified

161

Learners

3

Reviews

2.3

Rating

47

Courses

A data craftsman with over 20 years of experience in databases and IT. As a DBA and manager of a DB Platform team, I work with database platforms and specialize in MySQL, PostgreSQL, Oracle, MongoDB, SQL tuning, AWS, Terraform, and Python. Drawing on experience in the gaming, finance, and IT services industries, I explain database and cloud architecture. I have published 『Oracle Practical Tuning: Learning SQL Patterns』 and 『Oracle Pro*C Practical Project Guide』, and have presented on serverless architectures, database selection, and multi-database strategies at AWS Summit 2018 and 2019 and DataYa Nolja 2020. Recently, I have been working on slow-query analysis and tuning recommendations using Bedrock LLM, automated DB specification sizing, and query workflows through a DB metadata MCP server and Slack bot. I explain database automation for developers and AI applications for non-developers through hands-on exercises tailored to the audience and objectives of each course. Rather than applying AI suggestions as-is, I teach a decision-making framework that verifies result equivalence, execution plans, and observability conditions, and defers action when the supporting evidence is insufficient. Company operational data and credentials are not included in the course materials.

More

Curriculum

All

81 lectures ∙ (9hr 24min)

Course Materials:

Lecture resources
Published: 
Last updated: 

Reviews

Not enough reviews.
Please write a valuable review that helps everyone!

dorian05202988's other courses

Check out other courses by the instructor!

Similar courses

Explore other courses in the same field!

Limited time deal

$45.10

24%

$59.40