> I think the real problem is not indexing correctly but rather modeling your problem correctly.
There's also the issue that usage might change over time due to events outside of your control, that affects what the correct solution should look like.
For example, there's always a tradeoff between development effort and performance. It doesn't make financial sense spending tons of engineering time on optimizing a process that's done once per day and for which the simple solution is more than fast enough even though it takes an hour.
But if external circumstances change and that process suddenly needs to run every minute... perhaps not so easy to accommodate without drastic changes.