How do composite B-Tree indexes and the leftmost prefix rule optimize SQL queries?
A composite B-Tree index on (col_a, col_b, col_c) sorts entries hierarchically by col_a first, then col_b, then col_c—accelerating filters on col_a or (col_a, col_b) directly, whereas filtering on col_b alone usually cannot seek efficiently.