Tagged articles
8 articles
Page 1 of 1
Architect's Guide
Architect's Guide
Dec 5, 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 how it affects ORDER BY and GROUP BY queries with LIMIT, provides code examples and EXPLAIN output, and argues that disabling it often yields better performance for skewed data distributions.

Index Scanmysqloptimizer_switch
0 likes · 7 min read
When Should You Turn Off MySQL’s prefer_ordering_index? A Deep Dive
Top Architect
Top Architect
Nov 29, 2025 · Databases

Should You Disable MySQL’s prefer_ordering_index? A Practical Performance Guide

This article examines MySQL’s optimizer_switch ‘prefer_ordering_index’ setting, explains how it influences ORDER BY/GROUP BY queries with LIMIT, demonstrates cases where keeping it ON harms performance due to costly index scans, and provides concrete SQL examples and recommendations to turn it off in most scenarios.

Index Scanfilesortmysql
0 likes · 8 min read
Should You Disable MySQL’s prefer_ordering_index? A Practical Performance Guide
Architect
Architect
Nov 25, 2025 · Databases

When Should You Disable MySQL’s prefer_ordering_index? A Practical Guide

This article explains the purpose of MySQL’s optimizer_switch ‘prefer_ordering_index’, shows how it affects ORDER BY/GROUP BY queries with LIMIT, provides sample tables and procedures, compares EXPLAIN output with the option ON and OFF, and concludes why disabling it is often the safer choice for most workloads.

Index Scanexplainmysql
0 likes · 8 min read
When Should You Disable MySQL’s prefer_ordering_index? A Practical Guide
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
dbaplus Community
dbaplus Community
Oct 30, 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, why the default ON can hurt performance on skewed data, and demonstrates with table creation, data‑loading procedures, and EXPLAIN output how turning the option OFF often yields faster queries.

Index Scanfilesortmysql
0 likes · 7 min read
When Should You Turn Off MySQL’s prefer_ordering_index? A Deep Dive
Aikesheng Open Source Community
Aikesheng Open Source Community
Jan 21, 2025 · Databases

Understanding MySQL EXPLAIN EXTRA Hints: Impossible, No Matching, Recursive, Rematerialize, and Canned N Databases

This article explains the meaning and optimization strategies for various MySQL EXPLAIN EXTRA hints—including Impossible WHERE/HAVING, No matching rows, Recursive queries, Rematerialize, and canned N databases—provides example execution plans, code snippets, and performance comparisons to help developers write more efficient SQL statements.

Derived Tablesexplainmysql
0 likes · 10 min read
Understanding MySQL EXPLAIN EXTRA Hints: Impossible, No Matching, Recursive, Rematerialize, and Canned N Databases
Aikesheng Open Source Community
Aikesheng Open Source Community
Sep 10, 2021 · Databases

Understanding MySQL 8.0 Derived Condition Pushdown Optimization and Its Impact on User Variables

The article explains MySQL 8.0.22's new optimizer_switch variable derived_condition_pushdown, shows how enabling it can cause unexpected results with user‑defined variables in outer WHERE clauses, provides test cases, explains the underlying behavior, and offers three practical solutions.

derived_condition_pushdownmysqloptimizer
0 likes · 7 min read
Understanding MySQL 8.0 Derived Condition Pushdown Optimization and Its Impact on User Variables
Aikesheng Open Source Community
Aikesheng Open Source Community
Jun 16, 2020 · Databases

Understanding and Optimizing MySQL Multi-Range Read (MRR)

This article explains MySQL's Multi-Range Read (MRR) optimization, demonstrates its performance impact through experiments, shows how to enable or disable MRR via optimizer_switch, and provides guidance on tuning related parameters such as mrr_cost_based and read_rnd_buffer_size for optimal query execution.

Database PerformanceMRRmysql
0 likes · 7 min read
Understanding and Optimizing MySQL Multi-Range Read (MRR)