On the complexity of generating optimal left-deep processing trees with cross products
Producing optimal left-deep trees is known to be NP-complete for general join graphs and a quite complex cost function counting disk accesses for a special block-wise nested-loop join . Independent of any cost function is the dynamic programming approach to join ordering. The number of alternatives this approach generates is known as well . Further, it is known that for some cost functions — those fulfilling the ASI property  — the problem can be solved in polynomial time for acyclic query graph, i.e., tree queries [2, 3].
Unfortunately, some cost functions like sort merge could not be treated so far. We do so by a slight detour showing that this cost function (and others too) are optimized if and only if the sum of the intermediate result sizes is minimized. This validates the database folklore that minimizing intermediate result sizes is a good heuristic. Then we show that summarizing the intermediate result sizes has the ASI property. It further motivates us to restrict the subsequent investigations to this cost function called Cout for which we show that the problem remains NP-complete in the general case.
Then, we concentrate on the main topic of the paper: the complexity of producing left-deep processing trees possibly containing cross products. Considering cross products is known to possibly result in cheaper plans
KeywordsCost Function Dynamic Programming Polynomial Time Cross Product Dynamic Programming Approach
Unable to display preview. Download preview PDF.
- 1.Garey, J., Johnson, D.: Computers and Intractability: a Guide to the Theory of NP-Completeness. Freeman, San Francisco (1979)Google Scholar
- 2.Ibaraki, T., Kameda, T.: Optimal Nesting for computing n-Relational Joins. ACM. Trans. on Database Systems, 9(3) (1984) 482–502Google Scholar
- 3.Krishnamurthy, R., Boral, H., Zaniolo, C.: Optimization of Nonrecursive Queries. Proc. Int. Conf. Very Large Databases (VLDB), (1986), 128–137Google Scholar
- 4.Monma, C., Sidney, J.: Sequencing with Series-Parallel Precedence Constraints. Math. Oper. Res,. 4 (1979), 215–224Google Scholar
- 5.Ono, K., Lohman, G.: Measuring the Complexity of Join Enumeration in Query Optimization. Proc. Int. Conf. Very Large Databases (VLDB), (1990), 314–325Google Scholar
- 6.Selinger, P., Astrahan, M., Chamberlin, D., Lorie, R., Price, T.: Access Path Selection in a Relational Database Management System. Proc. Int. Conf. Management of Data (ACM SIGMOD), (1979), 23–34Google Scholar