arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 1108.1228cs.DBcs.IR
收藏

正则表达式查询索引的设计与实现

An index for regular expression queries: Design and implementation

Dominic Tsang, Sanjay Chawla

摘要:

Like正则表达式谓词至少从1989年起就成为SQL标准的一部分。然而,尽管它的流行和广泛的使用,数据库供应商只提供有限的索引支持正则表达式查询,几乎总是需要一个完整的表扫描。在本文中,我们提出了一个严格的和强大的方法,为正则表达式查询提供索引支持。我们的方法包括制定索引问题作为一个组合优化问题。我们从一个数据库开始,它被抽象为字符串的集合。从这个数据集,我们生成一个查询工作负载。优化问题的输入是数据库和工作负载。输出是一组多重字符(子字符串),可以用作满足查询工作负载的记录的键。然后可以将multigram与数据结构(如B+树)集成,为查询提供索引支持。我们提供了一个确定性和随机近似算法(可证明的保证)来解决优化问题。在合成数据集上的大量实验表明,该方法是准确和有效的。我们还提出了一个案例研究的PROSITE模式-这是复杂的正则表达式签名类蛋白质。同样,我们能够证明我们的索引方法在准确性和效率方面的实用性。因此,也许是第一次,有一个强大的和实用的索引机制,为一类重要的数据库查询。

英文摘要:

The like regular expression predicate has been part of the SQL standard since at least 1989. However, despite its popularity and wide usage, database vendors provide only limited indexing support for regular expression queries which almost always require a full table scan. In this paper we propose a rigorous and robust approach for providing indexing support for regular expression queries. Our approach consists of formulating the indexing problem as a combinatorial optimization problem. We begin with a database, abstracted as a collection of strings. From this data set we generate a query workload. The input to the optimization problem is the database and the workload. The output is a set of multigrams (substrings) which can be used as keys to records which satisfy the query workload. The multigrams can then be integrated with the data structure (like B+ trees) to provide indexing support for the queries. We provide a deterministic and a randomized approximation algorithm (with provable guarantees) to solve the optimization problem. Extensive experiments on synthetic data sets demonstrate that our approach is accurate and efficient. We also present a case study on PROSITE patterns - which are complex regular expression signatures for classes of proteins. Again, we are able to demonstrate the utility of our indexing approach in terms of accuracy and efficiency. Thus, perhaps for the first time, there is a robust and practical indexing mechanism for an important class of database queries.

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

↑