Hacker News new | ask | show | jobs
by dgb23 1204 days ago
Not GP. But you can often anticipate where indexes have to go for common queries.

There might be some important colums like say a “status” or a “date”, which are fundamental to a lot of queries.

Or you have colums X and Y being used frequently or importantly in where clauses together, then that’s a candidate for composite indexes.

Stuff like that.

1 comments

I think historically people had a lot of bad intuitions about how effective non-composite indexes are in databases. That if I have an index for A and an index for B I should be able to do A & B and get a quick answer.

There's been a lot more educational material on composite indexes and in particular partial indexes and so I'm not sure if someone with 3 years' experience today can accurately judge a conversation talking about ten years ago.