4 ms·
A lot of people are saying 'just trust the query planner'. The best of both worlds would be the ability to explicitly define how to get what you want just as e
by jamesrom 11y ago
A lot of people are saying 'just trust the query planner'.
The best of both worlds would be the ability to explicitly define how to get what you want just as easily as you can define what you want.
That should be the goal.
- MSM 11y agoSQL gives you all of the tools you need to hang yourself if you're bent on it. FORCE ORDER will force joins to happen in the order specified, index / join hints will force the optimizer to do things the way you'd like. The reason these things aren't seen often is because they are a terrible code smell. An index that works today may not be the best bet tomorrow. The beauty of the optimizer is it takes the (estimated) statistics available to it on execution to build a performant plan. The author is basically taking a huge no-no (forcing specific index use / order of operations) and somehow trying to sell that as a positive.