Anyway, it doesn't get much simpler than: add_index :users, :account_id
Anyway, it doesn't get much simpler than: add_index :users, :account_id
Near trivial example: what index or indices do you need to support the business requirement "I want to know how long users stay active after they sign up, and I want you to be able to slice that data by signup date and by whether they're paying customers or not."
So programmer Bob goes off and does this.
"Oh, Bob, the screen only lets me slice the data by signup date and by customer type, but I want to slice by both at once."
So Bob makes a one line tweak to his controller (to use both conditions, instead of one or the other)... and BOOM, down goes the poor server.
But yeah. It's complicated. "Software is hard." But the best thing you can do is become aware of your ignorance, then try to eliminate what you can.