Tag

optimizer trace

0 views collected around this technical thread.

Zhuanzhuan Tech
Zhuanzhuan Tech
Mar 6, 2024 · Databases

Diagnosing and Resolving MySQL Optimizer Mis‑selection of Indexes

This article recounts a real‑world incident where MySQL 5.7 chose a sub‑optimal index, causing a three‑second slow query, and explains how the team identified the root cause, used EXPLAIN and optimizer trace, and applied fixes such as forced index hints and data cleanup.

EXPLAINIndex SelectionMySQL
0 likes · 11 min read
Diagnosing and Resolving MySQL Optimizer Mis‑selection of Indexes
macrozheng
macrozheng
Oct 13, 2023 · Backend Development

Why MySQL Sometimes Chooses Full Table Scans Over Indexes—and How to Diagnose It

This article explains how MySQL's optimizer calculates execution costs for different indexes, why it may select a full table scan instead of an apparently better index, and shows how to use EXPLAIN and optimizer trace to reveal and improve the chosen execution plan.

EXPLAINIndex OptimizationMySQL
0 likes · 11 min read
Why MySQL Sometimes Chooses Full Table Scans Over Indexes—and How to Diagnose It
Java Architect Essentials
Java Architect Essentials
Sep 15, 2023 · Databases

How MySQL Chooses Indexes: Cost Calculation and Optimization Techniques

This article explains how MySQL calculates execution costs for different indexes using IO and CPU metrics, demonstrates with a sample table and queries, compares the optimizer's choices with actual performance, and shows how to use EXPLAIN and optimizer trace to fine‑tune query plans.

EXPLAINIndex OptimizationMySQL
0 likes · 10 min read
How MySQL Chooses Indexes: Cost Calculation and Optimization Techniques
Aikesheng Open Source Community
Aikesheng Open Source Community
Jun 28, 2023 · Databases

Analyzing Slow UPDATE Locks in MySQL 5.7 and Optimizing with Indexes and Optimizer Trace

The article investigates why an UPDATE statement on a MySQL 5.7 InnoDB table with RR isolation experiences high lock time, demonstrates how missing indexes cause full‑table scans and blocking, and shows how adding an index and using optimizer trace can diagnose and resolve the issue.

IndexInnoDBLock
0 likes · 8 min read
Analyzing Slow UPDATE Locks in MySQL 5.7 and Optimizing with Indexes and Optimizer Trace
Aikesheng Open Source Community
Aikesheng Open Source Community
May 30, 2023 · Databases

Understanding MySQL Optimizer Trace: Viewing the Full Query Optimization Process

This article explains how to enable MySQL's optimizer_trace feature, retrieve the detailed execution plan from the information_schema.OPTIMIZER_TRACE table, and interpret the cost‑based optimization phases (prepare, optimize, execute) to understand why the optimizer selects a particular index for a query.

EXPLAINMySQLPerformance
0 likes · 11 min read
Understanding MySQL Optimizer Trace: Viewing the Full Query Optimization Process
Sohu Tech Products
Sohu Tech Products
May 4, 2023 · Databases

Comprehensive Guide to Analyzing and Optimizing Slow SQL Queries in MySQL

This article explains why SQL queries become slow, how to capture slow queries using MySQL's slow query log, and provides detailed step‑by‑step methods for analyzing execution plans, profiling, optimizer tracing, and I/O parameters to identify and resolve performance bottlenecks.

EXPLAINI/OMySQL
0 likes · 27 min read
Comprehensive Guide to Analyzing and Optimizing Slow SQL Queries in MySQL
Aikesheng Open Source Community
Aikesheng Open Source Community
Dec 27, 2022 · Databases

Understanding How MySQL Converts Uncorrelated Subqueries to Correlated Subqueries and Their Execution Plans

This article explains the process by which MySQL transforms uncorrelated IN subqueries into correlated subqueries, details the differences in EXPLAIN output columns, explores optimizer trace information, compares materialization versus correlated execution costs, and provides best‑practice recommendations for writing efficient queries.

Database PerformanceEXPLAINMySQL
0 likes · 15 min read
Understanding How MySQL Converts Uncorrelated Subqueries to Correlated Subqueries and Their Execution Plans
Aikesheng Open Source Community
Aikesheng Open Source Community
Apr 2, 2021 · Databases

Why MySQL Chooses a Composite Index Even When the Query Skips the Leftmost Column

This article explains why MySQL may still use a composite index as a covering or range index despite the query not following the leftmost‑prefix rule, by analyzing optimizer trace output and demonstrating the behavior with concrete experiments.

Covering IndexDatabase PerformanceMySQL
0 likes · 3 min read
Why MySQL Chooses a Composite Index Even When the Query Skips the Leftmost Column
macrozheng
macrozheng
Jun 8, 2020 · Databases

Why MySQL’s Index Choice Can Miss the Best Plan – A Deep Cost Analysis

This article examines how MySQL estimates execution costs for queries, explains why COUNT(*) can be optimal, demonstrates index selection with real‑world examples, and shows how optimizer_trace can reveal mismatches between estimated and actual performance.

EXPLAINIndex OptimizationMySQL
0 likes · 10 min read
Why MySQL’s Index Choice Can Miss the Best Plan – A Deep Cost Analysis