A Decidable Case of Query Determinacy: Project-Select Views

Wen Zhang,Aurojit Panda,Mooly Sagiv,Scott Shenker
2024-11-14
Abstract:Query determinacy is decidable for project-select views and a project-select-join query with no self joins, as long as the selection predicates are in a first-order theory for which satisfiability is decidable.
Databases
What problem does this paper attempt to address?
The problem that this paper attempts to solve is: under specific conditions, whether query determinacy is decidable. Specifically, the author explores whether query determinacy can be determined in the case of project - select views and project - select - join queries with no self - joins. ### Problem Background Query determinacy means that given a set of views \( V \), whether these views can uniquely determine the result of a query \( Q \). That is, for any two database instances \( I \) and \( I' \), if the results of the view \( V \) on these two instances are the same, then the results of the query \( Q \) on these two instances must also be the same, that is: \[ V(I) = V(I') \implies Q(I) = Q(I') \] However, the decision problem of query determinacy is undecidable, even for simple conjunctive queries (CQ). Therefore, researchers have been looking for decidable cases in specific scenarios. ### Main Contributions of the Paper In this paper, the author proves that query determinacy is decidable in the following cases: 1. **Views**: Only include project - select operations. 2. **Queries**: Are project - select - join queries and do not include self - joins. 3. **Selection Predicates**: Selection conditions belong to a certain first - order theory, and the satisfiability of this theory is decidable. ### Representation of Formulas To check query determinacy, the author reduces the problem to the satisfiability problem of a logical formula. Specifically, for each relation \( R_i \), it is necessary to check whether the following formula holds: \[ \forall t: \theta(t) \Rightarrow \bigvee_{j = 1}^{n_i}(\theta_{i,j}(t_i)\land\forall t'_i: \Phi_{i,j}(t_i, t'_i)\Rightarrow\Psi_{i,j}(t, t'_i)) \] where the sub - formulas \( \Phi_{i,j} \) and \( \Psi_{i,j} \) are defined as follows: \[ \Phi_{i,j}(t_i, t'_i)\triangleq\theta_{i,j}(t'_i)\land t'_i[U_{i,j}] = t_i[U_{i,j}] \] \[ \Psi_{i,j}(t, t'_i)\triangleq\text{let }s = t\text{ except }i\mapsto t'_i\text{ in }\theta(s)\land s[U] = t[U] \] ### Conclusion Through the above formulas, query determinacy can be effectively checked under certain specific conditions (such as when selection predicates belong to a decidable first - order theory). This provides a new and broader decidable case for view - based access control policies, although it still has certain limitations because views in practical applications usually include join operations. But this is an important progress and provides a basis for future research.