Tagged articles
2 articles
Page 1 of 1
dbaplus Community
dbaplus Community
Apr 10, 2024 · Databases

How MySQL Chooses the Cheapest Index for COUNT(*) and When It Gets It Wrong

This article examines whether SELECT COUNT(*) causes full‑table scans, explains MySQL’s optimizer cost‑based index selection (including IO and CPU costs), demonstrates with a 100k‑row table how auxiliary indexes are chosen, and shows cases where the optimizer’s estimates mislead performance.

Index CostOptimizer_trace_count
0 likes · 9 min read
How MySQL Chooses the Cheapest Index for COUNT(*) and When It Gets It Wrong
ITPUB
ITPUB
Jul 18, 2017 · Databases

Mastering MySQL B-Tree Indexes: How They Work and How to Optimize Queries

This article explains the inner workings of MySQL B‑Tree indexes, how the optimizer chooses the cheapest execution plan, demonstrates practical examples of index matching, cost calculation, and EXPLAIN analysis, and provides step‑by‑step troubleshooting techniques for real‑world performance issues.

B-Tree IndexDatabase PerformanceIndex Cost
0 likes · 16 min read
Mastering MySQL B-Tree Indexes: How They Work and How to Optimize Queries