Tagged articles
6 articles
Page 1 of 1
Architecture & Thinking
Architecture & Thinking
Oct 27, 2023 · Databases

How to Choose the Optimal Prefix Length for MySQL Indexes

This article explains why indexing long character columns can bloat MySQL indexes, introduces the concept of index selectivity, shows how to calculate the best prefix length with real‑world queries, and demonstrates performance differences between short and optimal index prefixes.

Prefix IndexSelectivityindex
0 likes · 8 min read
How to Choose the Optimal Prefix Length for MySQL Indexes
JavaEdge
JavaEdge
Jul 26, 2020 · Databases

How to Choose and Use Prefix Indexes for String Columns in MySQL

This article explains why and how to create prefix indexes for string fields in MySQL, compares full‑column and prefix indexes with concrete examples, shows how to pick an optimal prefix length using cardinality statistics, and discusses alternative solutions such as reverse storage and hash fields.

Database OptimizationPrefix IndexSQL
0 likes · 12 min read
How to Choose and Use Prefix Indexes for String Columns in MySQL