Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

But a multicolumn index on (b, c, a) would be effective for a query on (b, c), as well as on (a, b, c).


but not for any combination that doesn't have B leading.

If you're always going to query those fields in that order, that's a perfect way to do things. If you'll be querying it a couple different ways then you're way better off with three separate one column indexes assuming the RDBMS can make use of index intersection.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: