数据库查询的排序枚举

Nikolaos Tziavelis, Wolfgang Gatterbauer, Mirek Riedewald
{"title":"数据库查询的排序枚举","authors":"Nikolaos Tziavelis, Wolfgang Gatterbauer, Mirek Riedewald","doi":"arxiv-2409.08142","DOIUrl":null,"url":null,"abstract":"Ranked enumeration is a query-answering paradigm where the query answers are\nreturned incrementally in order of importance (instead of returning all answers\nat once). Importance is defined by a ranking function that can be specific to\nthe application, but typically involves either a lexicographic order (e.g.,\n\"ORDER BY R.A, S.B\" in SQL) or a weighted sum of attributes (e.g., \"ORDER BY\n3*R.A + 2*S.B\"). We recently introduced any-k algorithms for (multi-way) join\nqueries, which push ranking into joins and avoid materializing intermediate\nresults until necessary. The top-ranked answers are returned asymptotically\nfaster than the common join-then-rank approach of database systems, resulting\nin orders-of-magnitude speedup in practice. In addition to their practical usefulness, our techniques complement a long\nline of theoretical research on unranked enumeration, where answers are also\nreturned incrementally, but with no explicit ordering requirement. For a broad\nclass of ranking functions with certain monotonicity properties, including\nlexicographic orders and sum-based rankings, the ordering requirement\nsurprisingly does not increase the asymptotic time or space complexity, apart\nfrom logarithmic factors. A key insight of our work is the connection between ranked enumeration for\ndatabase queries and the fundamental task of computing the kth-shortest path in\na graph. Uncovering these connections allowed us to ground our approach in the\nrich literature of that problem and connect ideas that had been explored in\nisolation before. In this article, we adopt a pragmatic approach and present a\nslightly simplified version of the algorithm without the shortest-path\ninterpretation. We believe that this will benefit practitioners looking to\nimplement and optimize any-k approaches.","PeriodicalId":501123,"journal":{"name":"arXiv - CS - Databases","volume":null,"pages":null},"PeriodicalIF":0.0000,"publicationDate":"2024-09-12","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":"{\"title\":\"Ranked Enumeration for Database Queries\",\"authors\":\"Nikolaos Tziavelis, Wolfgang Gatterbauer, Mirek Riedewald\",\"doi\":\"arxiv-2409.08142\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"Ranked enumeration is a query-answering paradigm where the query answers are\\nreturned incrementally in order of importance (instead of returning all answers\\nat once). Importance is defined by a ranking function that can be specific to\\nthe application, but typically involves either a lexicographic order (e.g.,\\n\\\"ORDER BY R.A, S.B\\\" in SQL) or a weighted sum of attributes (e.g., \\\"ORDER BY\\n3*R.A + 2*S.B\\\"). We recently introduced any-k algorithms for (multi-way) join\\nqueries, which push ranking into joins and avoid materializing intermediate\\nresults until necessary. The top-ranked answers are returned asymptotically\\nfaster than the common join-then-rank approach of database systems, resulting\\nin orders-of-magnitude speedup in practice. In addition to their practical usefulness, our techniques complement a long\\nline of theoretical research on unranked enumeration, where answers are also\\nreturned incrementally, but with no explicit ordering requirement. For a broad\\nclass of ranking functions with certain monotonicity properties, including\\nlexicographic orders and sum-based rankings, the ordering requirement\\nsurprisingly does not increase the asymptotic time or space complexity, apart\\nfrom logarithmic factors. A key insight of our work is the connection between ranked enumeration for\\ndatabase queries and the fundamental task of computing the kth-shortest path in\\na graph. Uncovering these connections allowed us to ground our approach in the\\nrich literature of that problem and connect ideas that had been explored in\\nisolation before. In this article, we adopt a pragmatic approach and present a\\nslightly simplified version of the algorithm without the shortest-path\\ninterpretation. We believe that this will benefit practitioners looking to\\nimplement and optimize any-k approaches.\",\"PeriodicalId\":501123,\"journal\":{\"name\":\"arXiv - CS - Databases\",\"volume\":null,\"pages\":null},\"PeriodicalIF\":0.0000,\"publicationDate\":\"2024-09-12\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"0\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"arXiv - CS - Databases\",\"FirstCategoryId\":\"1085\",\"ListUrlMain\":\"https://doi.org/arxiv-2409.08142\",\"RegionNum\":0,\"RegionCategory\":null,\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"\",\"JCRName\":\"\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"arXiv - CS - Databases","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/arxiv-2409.08142","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0

摘要

排序枚举是一种查询回答范例,在这种范例中,查询答案按重要性顺序逐步返回(而不是一次性返回所有答案)。重要性由一个排序函数来定义,该函数可以是特定于应用的,但通常涉及一个词法排序(例如,SQL 中的 "ORDER BY R.A,S.B")或一个属性加权和(例如,"ORDER BY3*R.A + 2*S.B")。我们最近为(多向)连接查询引入了 any-k 算法,它将排序推入连接,并在必要时避免中间结果的具体化。与数据库系统中常见的先连接后排名的方法相比,排名靠前的答案的返回速度在渐近上更快,从而在实践中实现了数量级的提速。除了实用性之外,我们的技术也是对无排序枚举理论研究的补充,在无排序枚举中,答案也是逐步返回的,但没有明确的排序要求。对于一类具有某些单调性的排序函数,包括线性排序和基于和的排序,除了对数因素外,排序要求出人意料地没有增加渐进时间或空间复杂性。我们工作的一个关键见解是数据库查询的排序枚举与计算图中第 k 条最短路径这一基本任务之间的联系。发现这些联系使我们能够将我们的方法建立在有关该问题的丰富文献基础之上,并将以前孤立探索过的观点联系起来。在本文中,我们采用了一种务实的方法,提出了一个略微简化的算法版本,但没有对最短路径进行解释。我们相信,这将有益于希望实施和优化任意 K 方法的实践者。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
Ranked Enumeration for Database Queries
Ranked enumeration is a query-answering paradigm where the query answers are returned incrementally in order of importance (instead of returning all answers at once). Importance is defined by a ranking function that can be specific to the application, but typically involves either a lexicographic order (e.g., "ORDER BY R.A, S.B" in SQL) or a weighted sum of attributes (e.g., "ORDER BY 3*R.A + 2*S.B"). We recently introduced any-k algorithms for (multi-way) join queries, which push ranking into joins and avoid materializing intermediate results until necessary. The top-ranked answers are returned asymptotically faster than the common join-then-rank approach of database systems, resulting in orders-of-magnitude speedup in practice. In addition to their practical usefulness, our techniques complement a long line of theoretical research on unranked enumeration, where answers are also returned incrementally, but with no explicit ordering requirement. For a broad class of ranking functions with certain monotonicity properties, including lexicographic orders and sum-based rankings, the ordering requirement surprisingly does not increase the asymptotic time or space complexity, apart from logarithmic factors. A key insight of our work is the connection between ranked enumeration for database queries and the fundamental task of computing the kth-shortest path in a graph. Uncovering these connections allowed us to ground our approach in the rich literature of that problem and connect ideas that had been explored in isolation before. In this article, we adopt a pragmatic approach and present a slightly simplified version of the algorithm without the shortest-path interpretation. We believe that this will benefit practitioners looking to implement and optimize any-k approaches.
求助全文
通过发布文献求助,成功后即可免费获取论文全文。 去求助
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术官方微信