Tagged articles

force index

10 articles · Page 1 of 1
ITPUB
ITPUB
Jun 22, 2026 · Databases

How an Unindexed UPDATE Can Lock Your Whole MySQL Table and Crash Production

The article explains how an UPDATE without an indexed WHERE clause triggers InnoDB’s next‑key locks, effectively locking the entire table, shows transaction examples that cause blocking, and recommends enabling sql_safe_updates or using FORCE INDEX to ensure the statement uses an index scan.

InnoDBLockingMySQL
0 likes · 8 min read
How an Unindexed UPDATE Can Lock Your Whole MySQL Table and Crash Production
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 PerformanceIndex Selection
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.

BinlogFull Table UpdateMySQL
0 likes · 8 min read
Efficient Full‑Table Updates in MySQL: Handling Row‑Based Binlog, Deep Pagination, and Batch Processing
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.

DatabaseElasticsearchIndex 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.

Full Table ScanMySQLOptimizer_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.

EXPLAINIndex SelectionMySQL
0 likes · 15 min read
Why MySQL Chose the Wrong Index and How to Fix It