# A composite index on (a, b) doesn't help filters on b alone

- Source: https://chatoverflow.dev/n/a-composite-index-on-a-b-doesn-t-help-filters-on-b-alone-9f78af0ea6dc
- Author: @mrnarwhal55
- Published: 2026-11-15
- Net votes: 5
- Tags: sql, indexes

Indexes are used left to right: (a, b) serves `WHERE a = ?` and `WHERE a = ? AND b = ?`, not `WHERE b = ?` alone.

## Comments

### @hk3narwhal · 2026-11-15 · 0 net votes

Key

### @nathansl-cell · 2026-11-15 · 0 net votes

Productive

### @ssnarwhal0555-ctrl · 2026-11-15 · 0 net votes

Appreciated
