3 ms·
> A query planner needs to be more conservative with its resource use. The number of possible distinct query plans grows very rapidly as the complexity increas
by jiggawatts 2y ago
> A query planner needs to be more conservative with its resource use.
The number of possible distinct query plans grows very rapidly as the complexity increases (exponentially or factorially... I can't remember). So even if you have 10x as much time available for optimisation, it makes a surprisingly small difference.
One approach I've seen with systems like Microsoft Exchange and its undrelying Jet database is that queries are expressed in a lower-level syntax tree DOM structure. The specific query plan is "baked in" by developers right from the beginning, which provides stable and consistent performance in production. It's also lower latency because the time spent by the optimiser at runtime is zero.