Soft and Constrained Hypertree Width

Matthias Lanzinger,Cem Okulmus,Reinhard Pichler,Alexander Selzer,Georg Gottlob
2024-12-16
Abstract:Hypertree decompositions provide a way to evaluate Conjunctive Queries (CQs) in polynomial time, where the exponent of this polynomial is determined by the width of the decomposition. In theory, the goal of efficient CQ evaluation therefore has to be a minimisation of the width. However, in practical settings, it turns out that there are also other properties of a decomposition that influence the performance of query evaluation. It is therefore of interest to restrict the computation of decompositions by constraints and to guide this computation by preferences. To this end, we propose a novel framework based on candidate tree decompositions, which allows us to introduce soft hypertree width (shw). This width measure is a relaxation of hypertree width (hw); it is never greater than hw and, in some cases, shw may actually be lower than hw. ost importantly, shw preserves the tractability of deciding if a given CQ is below some fixed bound, while offering more algorithmic flexibility. In particular, it provides a natural way to incorporate preferences A prototype implementation and preliminary experiments confirm that this novel framework can indeed have a practical impact on query evaluation.
Databases
What problem does this paper attempt to address?
The problem that this paper attempts to solve is: on the premise of keeping the theoretical computational complexity controllable, how to optimize the solving efficiency of conjunctive queries (CQs) by introducing a more flexible decomposition framework. Specifically, the paper proposes a new width measure - soft hypertree width (shw) to improve the existing hypertree width (hw). shw not only retains the polynomial - time decidability of hw, but may also provide a smaller width value than hw in some cases, thus providing greater flexibility for query optimization. ### Background and Problem Description 1. **Hypertree Decomposition and Hypertree Width** - Hypertree decomposition (HD) is a method for efficiently solving CQ, and its width (hypertree width, hw) determines the exponential part in the polynomial - time complexity. - Theoretically, in order to efficiently solve CQ, the goal is to minimize the width of the decomposition. However, in practical applications, other properties of the decomposition also affect the query performance, such as the cost of local join operations. 2. **Limitations of Existing Methods** - Although hw has polynomial - time decidability, its strict special conditions limit the flexibility of the algorithm. - Generalized hypertree width (ghw) and fractional hypertree width (fhw), although they can provide smaller width values, their exact calculation is NP - hard. ### Solutions Proposed in the Paper 1. **Soft Hypertree Width (shw)** - The paper introduces soft hypertree width (shw), which relaxes the special conditions of HD, enabling it to produce smaller width values while maintaining polynomial - time decidability. - shw allows the introduction of preferences and constraints during the decomposition process, so as to better adapt to the requirements in practical application scenarios. 2. **Candidate Tree Decompositions (CTDs)** - By using the candidate tree decomposition framework, the paper proposes a new method based on candidate bags, which can flexibly handle different types of constraints and preferences. - This method is not only applicable to the calculation of shw, but can also be extended to the calculation of ghw and fhw. ### Main Contributions - **New Width Measure**: Introduced shw and its iterative version shw_i, forming a hierarchy from hw to ghw. - **Computational Flexibility**: Through the CTDs framework, shw can be calculated in polynomial time, and various constraints and preferences can be conveniently introduced. - **Experimental Verification**: Preliminary experimental results show that using shw and the CTDs framework can significantly improve the performance of query solving. In summary, this paper aims to overcome the limitations of existing methods in theoretical and practical applications by introducing shw and the CTDs framework, thereby providing a new and more flexible solution for the efficient solving of CQ.