Some progress on this. I filed and fixed two issues: * https://github.com/julianhyde/optiq/issues/301, "Add `Program` interface, a planner phase more general than current `RuleSet`” * https://github.com/julianhyde/optiq/issues/302, "Use heuristic rule to plan queries with large numbers of joins”.
I see Jacques has already commented on optiq-301 — good, it could make your life a lot better or a lot worse. :) The heuristic rule currently only works in one particular unit test with a hand-written set of rules. Working on making it more robust. The key advantage of optiq-299 over what has been done already is that if we converted the heuristically ordered join tree into clusters, and pure firewalls around those clusters, we would be able to re-enable SwapJoinRule and PushJoinThroughJoinRule without waking the combinatorial beast. Julian
