Tagged articles
5 articles
Page 1 of 1
ITPUB
ITPUB
Nov 22, 2025 · Databases

When Should You Turn Off MySQL’s prefer_ordering_index? A Deep Dive

This article explains the purpose of MySQL's optimizer_switch prefer_ordering_index, shows why the default ON setting can hurt performance with skewed data, and demonstrates with code and EXPLAIN output how turning it OFF can lead to faster queries for ORDER BY and GROUP BY scenarios.

Index Usagemysqloptimizer_switch
0 likes · 7 min read
When Should You Turn Off MySQL’s prefer_ordering_index? A Deep Dive
Liangxu Linux
Liangxu Linux
Jul 28, 2022 · Databases

Why Your MySQL Queries Are Slow and How to Fix Common Mistakes

This article examines frequent MySQL performance pitfalls—such as misuse of LIMIT, implicit type conversion, sub‑query updates, mixed sorting, EXISTS clauses, and condition push‑down failures—and demonstrates how rewriting queries with proper indexes, JOINs, early range reduction, and WITH statements can dramatically reduce execution time.

Index UsageQuery RewriteSQL Optimization
0 likes · 15 min read
Why Your MySQL Queries Are Slow and How to Fix Common Mistakes
Top Architect
Top Architect
Jul 5, 2021 · Databases

MySQL Implicit Type Conversion Leads to Unexpected Query Results

This article explains how MySQL implicitly converts mismatched column types—such as comparing a VARCHAR column with a numeric literal—into floating‑point numbers, causing seemingly equal values to match, losing index usage, and potentially producing incorrect query results.

Implicit ConversionIndex Usagefloating-point
0 likes · 7 min read
MySQL Implicit Type Conversion Leads to Unexpected Query Results