原文 https://use-the-index-luke.com
(创建对应 md 文件,并修改如下 title 为中文)
- 前言 — 为什么索引是一项开发任务?
- 解剖索引 — 一条索引长什么样?
- The Where Clause — Indexing to improve search performance
- The Equals Operator — Exact key lookup
- Primary Keys — Verifying index usage
- Concatenated Keys — Multi-column indexes
- Slow Indexes, Part II — The first ingredient, revisited
- Functions — Using functions in the
where
clause- Case-Insensitive Search —
UPPER
andLOWER
- User-Defined Functions — Limitations of function-based indexes
- Over-Indexing — Avoid redundancy
- Case-Insensitive Search —
- Bind Variables — For security and performance
- Searching for Ranges — Beyond equality
- Greater, Less and
BETWEEN
— The column order revisited - Indexing SQL
LIKE
Filters —LIKE
is not for full-text search - Index Combine — Why not using one index for every column?
- Greater, Less and
- Partial Indexes — Indexing selected rows
NULL
in the Oracle Database — An important curiosityNULL
in Indexes — Every index is a partial indexNOT NULL
Constraints — affect index usage- Emulating Partial Indexes — using function-based indexing
- Obfuscated Conditions — Common anti-patterns
- Dates — Pay special attention to
DATE
types - Numeric Strings — Don’t mix types
- Combining Columns — use redundant
where
clauses - Smart Logic — The smartest way to make SQL slow
- Math — Databases don’t solve equations
- Dates — Pay special attention to
- The Equals Operator — Exact key lookup
- Testing and Scalability — About hardware
- Data Volume — Sloppy indexing bites back
- System Load — Production load affects response time
- Response Time and Throughput — Horizontal scalability
- The Join Operation — Not slow, if done right
- Nested Loops — About the N+1 selects problem in ORM
- Hash Join — Requires an entirely different indexing approach
- Sort-Merge Join — Like a zipper on two sorted sets
- Clustering Data — To reduce IO
- Index Filter Predicates Intentionally Used — to tune
LIKE
- Index-Only Scan — Avoiding table access
- Index-Organized Table — Clustered indexes without tables
- Index Filter Predicates Intentionally Used — to tune
- Sorting and Grouping — Pipelined
order by
: the third power- Indexed Order By —
where
clause interactions ASC
/DESC
andNULL FIRST
/LAST
— changing index order- Indexed Group By — Pipelining
group by
- Indexed Order By —
- Partial Results — Paging efficiently
- Selecting Top-N Rows — if you need the first few rows only
- Fetching The Next Page — The offset and seek methods compared
- Window-Functions — Pagination using analytic queries
- Insert、Delete与Update — 索引对DML语句的影响
原文目录链接
- Preface — Why is indexing a development task?
- Anatomy of an Index — What does an index look like?
- The Leaf Nodes — A doubly linked list
- The B-Tree — It’s a balanced tree
- Slow Indexes, Part I — Two ingredients make the index slow
- The Where Clause — Indexing to improve search performance
- The Equals Operator — Exact key lookup
- Primary Keys — Verifying index usage
- Concatenated Keys — Multi-column indexes
- Slow Indexes, Part II — The first ingredient, revisited
- Functions — Using functions in the
where
clause- Case-Insensitive Search —
UPPER
andLOWER
- User-Defined Functions — Limitations of function-based indexes
- Over-Indexing — Avoid redundancy
- Case-Insensitive Search —
- Bind Variables — For security and performance
- Searching for Ranges — Beyond equality
- Greater, Less and
BETWEEN
— The column order revisited - Indexing SQL
LIKE
Filters —LIKE
is not for full-text search - Index Combine — Why not using one index for every column?
- Greater, Less and
- Partial Indexes — Indexing selected rows
NULL
in the Oracle Database — An important curiosityNULL
in Indexes — Every index is a partial indexNOT NULL
Constraints — affect index usage- Emulating Partial Indexes — using function-based indexing
- Obfuscated Conditions — Common anti-patterns
- Dates — Pay special attention to
DATE
types - Numeric Strings — Don’t mix types
- Combining Columns — use redundant
where
clauses - Smart Logic — The smartest way to make SQL slow
- Math — Databases don’t solve equations
- Dates — Pay special attention to
- The Equals Operator — Exact key lookup
- Testing and Scalability — About hardware
- Data Volume — Sloppy indexing bites back
- System Load — Production load affects response time
- Response Time and Throughput — Horizontal scalability
- The Join Operation — Not slow, if done right
- Nested Loops — About the N+1 selects problem in ORM
- Hash Join — Requires an entirely different indexing approach
- Sort-Merge Join — Like a zipper on two sorted sets
- Clustering Data — To reduce IO
- Index Filter Predicates Intentionally Used — to tune
LIKE
- Index-Only Scan — Avoiding table access
- Index-Organized Table — Clustered indexes without tables
- Index Filter Predicates Intentionally Used — to tune
- Sorting and Grouping — Pipelined
order by
: the third power- Indexed Order By —
where
clause interactions ASC
/DESC
andNULL FIRST
/LAST
— changing index order- Indexed Group By — Pipelining
group by
- Indexed Order By —
- Partial Results — Paging efficiently
- Selecting Top-N Rows — if you need the first few rows only
- Fetching The Next Page — The offset and seek methods compared
- Window-Functions — Pagination using analytic queries
- Insert, Delete and Update — Indexing impacts on DML statements