arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1905.02069cs.DB
收藏

混合集和包语义

Mixing set and bag semantics

Wilmer Ricciotti, James Cheney

摘要:

嵌套关系演算的保守性定理意味着查询表达式可以自由地使用嵌套和非嵌套,但只要查询结果类型是平面关系,这些功能就不会导致平面关系查询的表达能力的增加。此外,Wong还展示了如何通过构造性重写算法将这些查询转换为SQL。虽然这一结果适用于集合或多集合语义的查询,但据我们所知,对于混合集合和包集合的查询,或提供重复消除操作(如SQL的$\mathtt{SELECT}~\mathtt{DISTINCT}$)的查询,尚未研究保守性和规范化问题。在本文中,我们形式化的问题,并提出部分进展:具体而言,我们引入了一个集合和多集合集合类型的演算,随着自然的映射,从集到袋,反之亦然,提出了一组有效的重写规则规范化这样的查询,并给出了一个归纳的一组查询的范式可以翻译成SQL的表征。我们还考虑的例子,不出现直接转换为SQL,说明平面和嵌套查询的混合集和多集语义的相对表现力仍然是一个悬而未决的问题。

英文摘要:

The conservativity theorem for nested relational calculus implies that query expressions can freely use nesting and unnesting, yet as long as the query result type is a flat relation, these capabilities do not lead to an increase in expressiveness over flat relational queries. Moreover, Wong showed how such queries can be translated to SQL via a constructive rewriting algorithm. While this result holds for queries over either set or multiset semantics, to the best of our knowledge, the questions of conservativity and normalization have not been studied for queries that mix set and bag collections, or provide duplicate-elimination operations such as SQL's $\mathtt{SELECT}~\mathtt{DISTINCT}$. In this paper we formalize the problem, and present partial progress: specifically, we introduce a calculus with both set and multiset collection types, along with natural mappings from sets to bags and vice versa, present a set of valid rewrite rules for normalizing such queries, and give an inductive characterization of a set of queries whose normal forms can be translated to SQL. We also consider examples that do not appear straightforward to translate to SQL, illustrating that the relative expressiveness of flat and nested queries with mixed set and multiset semantics remains an open question.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑