The relational calculus (RC) is a concise, declarative query language. However, existing RC query evaluation approaches are inefficient and often deviate from established algorithms based on finite tables used in database management systems. We devise a new translation of an arbitrary RC query into two safe-range queries, for which the finiteness of the query's evaluation result is guaranteed. Assuming an infinite domain, the two queries have the following meaning: The first is closed and characterizes the original query's relative safety, i.e., whether given a fixed database, the original query evaluates to a finite relation. The second safe-range query is equivalent to the original query, if the latter is relatively safe. We compose our translation with other, more standard ones to ultimately obtain two SQL queries. This allows us to use standard database management systems to evaluate arbitrary RC queries. We show that our translation improves the time complexity over existing approaches, which we also empirically confirm in both realistic and synthetic experiments.
翻译:关系微积分(RC)是一个简明的、宣示性的查询语言。然而,现有的RC查询评价方法效率低下,往往偏离基于数据库管理系统使用的有限表格的既定算法。我们设计了将任意的RC查询转换成两个安全的查询,保证了查询结果的有限性。假设一个无限的域,两个查询具有以下含义:第一个是封闭的,是原始查询相对安全的特征,即是否给定了一个固定的数据库,原始查询评价与有限关系。第二个安全查询相当于原始查询,如果后者相对安全。我们用其他更标准的查询拼写我们的翻译,以便最终获得两个SQL查询。这使我们能够使用标准的数据库管理系统来评价任意的驻地协调员查询。我们表明,我们的翻译提高了现有方法的时间复杂性,我们在现实和合成试验中也从经验上确认了这些复杂性。