Tagged articles
9 articles
Page 1 of 1
Senior Tony
Senior Tony
Mar 26, 2026 · Databases

Why MySQL Optimizer Picks the Wrong Index and How to Fix It

The MySQL optimizer can select an inappropriate index due to inaccurate statistics or sampling errors, but you can correct this by refreshing statistics with ANALYZE TABLE, increasing sample pages, or explicitly forcing the right index using the FORCE INDEX hint.

ANALYZE TABLEDatabase PerformanceFORCE INDEX
0 likes · 4 min read
Why MySQL Optimizer Picks the Wrong Index and How to Fix It
Architect's Guide
Architect's Guide
Oct 1, 2024 · Databases

Efficient Full‑Table Updates in MySQL: Handling Row‑Based Binlog, Deep Pagination, and Batch Processing

The article explains why executing a full‑table UPDATE on large MySQL tables using row‑based binlog can overload replication, discusses the inefficiencies of deep pagination and IN clauses, and presents a batch‑processing strategy that leverages SQL_NO_CACHE and FORCE INDEX to safely and efficiently migrate data.

BinlogFORCE INDEXFull Table Update
0 likes · 8 min read
Efficient Full‑Table Updates in MySQL: Handling Row‑Based Binlog, Deep Pagination, and Batch Processing
Java Backend Technology
Java Backend Technology
Sep 25, 2024 · Databases

How to Safely Update Billion‑Row MySQL Tables Without Overloading Binlog

This article explains why a simple full‑table UPDATE on massive MySQL tables can cripple master‑slave replication, analyzes deep‑pagination inefficiencies, and presents a step‑by‑step batch‑update strategy using NO_CACHE and FORCE INDEX to keep binlog size and buffer‑pool impact under control.

BinlogFORCE INDEXFull Table Update
0 likes · 9 min read
How to Safely Update Billion‑Row MySQL Tables Without Overloading Binlog
JD Tech
JD Tech
Mar 29, 2024 · Databases

Root Cause Analysis and Optimization of a Slow MySQL Query Using Index Selection and Force Index

This article examines a MySQL slow‑query incident caused by the optimizer using the primary clustered index instead of an appropriate secondary index, explains the underlying index structures, and presents solutions such as FORCE INDEX and migrating complex queries to Elasticsearch for long‑term performance improvement.

ElasticsearchFORCE INDEXIndex Optimization
0 likes · 9 min read
Root Cause Analysis and Optimization of a Slow MySQL Query Using Index Selection and Force Index
Liangxu Linux
Liangxu Linux
Aug 15, 2022 · Databases

Why MySQL Picks a Full Table Scan Over an Index with ORDER BY id LIMIT 1

A MySQL 5.6+ optimizer bug causes queries that filter by uid and order by id with a small LIMIT to use a costly full table scan instead of the appropriate idx_uid_stat index, and the article explains the root cause, shows optimizer_trace output, and offers two practical work‑arounds.

FORCE INDEXFull Table ScanOptimizer_trace
0 likes · 8 min read
Why MySQL Picks a Full Table Scan Over an Index with ORDER BY id LIMIT 1
dbaplus Community
dbaplus Community
Aug 19, 2020 · Databases

Why MySQL Chose the Wrong Index and How to Fix It

A production MySQL query that should have returned instantly took 44 seconds because the optimizer selected the primary key index instead of a suitable composite index, and the article explains the root cause, the optimizer's decision process, and multiple practical solutions to prevent such slow‑query incidents.

Database OptimizationFORCE INDEXIndex Selection
0 likes · 15 min read
Why MySQL Chose the Wrong Index and How to Fix It