Tagged articles
7 articles
Page 1 of 1
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
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
ITPUB
ITPUB
Feb 21, 2023 · Databases

How MySQL Implements File Sorting: Internals, Modes, and Optimizations

This article explains MySQL's file‑sort mechanism in depth, covering the sort buffer, handling of long sort keys, three sort modes, priority‑queue and read‑rnd‑buffer optimizations, internal vs. external sorting, descending sort implementation, and how to inspect details with optimizer trace.

Optimizer_traceexternal sortingfilesort
0 likes · 32 min read
How MySQL Implements File Sorting: Internals, Modes, and Optimizations