Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
research-article

Tractable Orders for Direct Access to Ranked Answers of Conjunctive Queries

Published: 13 March 2023 Publication History

Abstract

We study the question of when we can provide direct access to the k-th answer to a Conjunctive Query (CQ) according to a specified order over the answers in time logarithmic in the size of the database, following a preprocessing step that constructs a data structure in time quasilinear in database size. Specifically, we embark on the challenge of identifying the tractable answer orderings, that is, those orders that allow for such complexity guarantees. To better understand the computational challenge at hand, we also investigate the more modest task of providing access to only a single answer (i.e., finding the answer at a given position), a task that we refer to as the selection problem, and ask when it can be performed in quasilinear time. We also explore the question of when selection is indeed easier than ranked direct access.
We begin with lexicographic orders. For each of the two problems, we give a decidable characterization (under conventional complexity assumptions) of the class of tractable lexicographic orders for every CQ without self-joins. We then continue to the more general orders by the sum of attribute weights and establish the corresponding decidable characterizations, for each of the two problems, of the tractable CQs without self-joins. Finally, we explore the question of when the satisfaction of Functional Dependencies (FDs) can be utilized for tractability and establish the corresponding generalizations of our characterizations for every set of unary FDs.

References

[1]
Amir Abboud and Virginia Vassilevska Williams. 2014. Popular conjectures imply strong lower bounds for dynamic problems. In FOCS. 434–443. DOI:
[2]
Nir Ailon and Bernard Chazelle. 2005. Lower bounds for linear degeneracy testing. J. ACM 52, 2 (2005), 157–171. DOI:
[3]
Noga Alon, Raphael Yuster, and Uri Zwick. 1997. Finding and counting given length cycles. Algorithmica 17, 3 (1997), 209–223. DOI:
[4]
Guillaume Bagan, Arnaud Durand, and Etienne Grandjean. 2007. On acyclic conjunctive queries and constant delay enumeration. In CSL. 208–222. DOI:
[5]
Guillaume Bagan, Arnaud Durand, Etienne Grandjean, and Frédéric Olive. 2008. Computing the jth solution of a first-order query. RAIRO-Theoret. Inform. Applic. 42, 1 (2008), 147–164. DOI:
[6]
Ilya Baran, Erik D. Demaine, and Mihai Pǎtraşcu. 2005. Subquadratic algorithms for 3SUM. In Algorithms and Data Structures. 409–421. DOI:
[7]
Christoph Berkholz, Fabian Gerhardt, and Nicole Schweikardt. 2020. Constant delay enumeration for conjunctive queries: A tutorial. ACM SIGLOG News 7, 1 (2020), 4–33. DOI:
[8]
Christoph Berkholz, Jens Keppeler, and Nicole Schweikardt. 2017. Answering conjunctive queries under updates. In PODS. 303–318. DOI:
[9]
Manuel Blum, Robert W. Floyd, Vaughan Pratt, Ronald L. Rivest, and Robert E. Tarjan. 1973. Time bounds for selection. J. Comput. Syst. Sci. 7, 4 (1973), 448–461. DOI:
[10]
Pierre Bourhis, Alejandro Grez, Louis Jachiet, and Cristian Riveros. 2021. Ranked enumeration of MSO logic on words. In ICDT. 20:1–20:19. DOI:
[11]
Johann Brault-Baron. 2013. De la Pertinence de l’énumération: Complexité en Logiques Propositionnelle et du Premier Ordre. Ph.D. Dissertation. U. de Caen. Retrieved from: https://hal.archives-ouvertes.fr/tel-01081392.
[12]
Nofar Carmeli and Markus Kröll. 2020. Enumeration complexity of conjunctive queries with functional dependencies. Theor. Comput. Syst. 64, 5 (2020), 828–860. DOI:
[13]
Nofar Carmeli, Nikolaos Tziavelis, Wolfgang Gatterbauer, Benny Kimelfeld, and Mirek Riedewald. 2021. Tractable orders for direct access to ranked answers of conjunctive queries. In PODS. 325–341. DOI:
[14]
Nofar Carmeli, Shai Zeevi, Christoph Berkholz, Benny Kimelfeld, and Nicole Schweikardt. 2020. Answering (unions of) conjunctive queries using random access and random-order enumeration. In PODS. 393–409. DOI:
[15]
Shaleen Deep and Paraschos Koutris. 2021. Ranked enumeration of conjunctive query results. In ICDT. 5:1–5:19. DOI:
[16]
Arnaud Durand. 2020. Fine-grained complexity analysis of queries: From decision to counting and enumeration. In PODS. 331–346. DOI:
[17]
Jeff Erickson. 1995. Lower bounds for linear satisfiability problems. In SODA. 388–395.
[18]
Robert W. Floyd and Ronald L. Rivest. 1975. Expected time bounds for selection. Commun. ACM 18, 3 (1975), 165–172. DOI:
[19]
Greg N. Frederickson. 1993. An optimal algorithm for selection in a min-heap. Inf. Comput. 104, 2 (1993), 197–214. DOI:
[20]
Greg N. Frederickson and Donald B. Johnson. 1984. Generalized selection and ranking: Sorted matrices. SIAM J. Comput. 13, 1 (1984), 14–30. DOI:
[21]
Cibele Freire, Wolfgang Gatterbauer, Neil Immerman, and Alexandra Meliou. 2015. The complexity of resilience and responsibility for self-join-free conjunctive queries. Proc. VLDB Endow. 9, 3 (2015), 180–191. DOI:
[22]
Anka Gajentaan and Mark H. Overmars. 1995. On a class of O(n2) problems in computational geometry. Computat. Geom. 5, 3 (1995), 165–185. DOI:
[23]
Wolfgang Gatterbauer and Dan Suciu. 2015. Approximate lifted inference with probabilistic databases. Proc. VLDB Endow. 8, 5 (2015), 629–640. DOI:
[24]
Wolfgang Gatterbauer and Dan Suciu. 2017. Dissociation and propagation for approximate lifted inference with standard relational database management systems. VLDB J. 26, 1 (2017), 5–30. DOI:
[25]
Martin Charles Golumbic. 1980. Algorithmic Graph Theory and Perfect Graphs. Elsevier, 81–104. DOI:
[26]
Georg Gottlob, Gianluigi Greco, Nicola Leone, and Francesco Scarcello. 2016. Hypertree decompositions: Questions and answers. In PODS. 57–74. DOI:
[27]
Etienne Grandjean. 1996. Sorting, linear time and the satisfiability problem. Ann. Math. Artif. Intell. 16, 1 (1996), 183–236. DOI:
[28]
Egbert Harzheim. 2006. Ordered Sets. Vol. 7. Springer Science & Business Media. DOI:
[29]
Russell Impagliazzo and Ramamohan Paturi. 2001. On the complexity of K-SAT. J. Comput. Syst. Sci. 62, 2 (2001), 367–375. DOI:
[30]
Donald B. Johnson and Tetsuo Mizoguchi. 1978. Selecting the Kth element in \(X + Y\) and \(X_1 + X_2 + \cdots + X_m\). SIAM J. Comput. 7, 2 (1978), 147–153. DOI:
[31]
Jens Keppeler. 2020. Answering Conjunctive Queries and FO+MOD Queries under Updates. Ph.D. Dissertation. Humboldt-Universität zu Berlin, Mathematisch-Naturwissenschaftliche Fakultät. DOI:
[32]
Benny Kimelfeld. 2012. A dichotomy in the complexity of deletion propagation with functional dependencies. In PODS. 191–202. DOI:
[33]
Andrea Lincoln, Virginia Vassilevska Williams, and R. Ryan Williams. 2018. Tight hardness for shortest cycles and paths in sparse graphs. In SODA. 1236–1252. DOI:
[34]
Stefan Mengel. 2021. A short note on the counting complexity of conjunctive queries. CoRR abs/2112.01108 (2021).
[35]
A. Mirzaian and E. Arjomandi. 1985. Selection in X + Y and matrices with sorted rows and columns. Inf. Process. Lett. 20, 1 (1985), 13–17. DOI:
[36]
Dan Olteanu and Maximilian Schleich. 2016. Factorized databases. SIGMOD Rec. 45, 2 (2016), 5–16. DOI:
[37]
Dan Olteanu and Jakub Zavodny. 2012. Factorised representations of query results: Size bounds and readability. In ICDT. 285–298. DOI:
[38]
Mihai Patrascu. 2010. Towards polynomial lower bounds for dynamic problems. In STOC. 603. DOI:
[39]
Mihai Pătraşcu and Ryan Williams. 2010. On the possibility of faster SAT algorithms. In SODA. 1065–1075. DOI:
[40]
Nikolaos Tziavelis, Deepak Ajwani, Wolfgang Gatterbauer, Mirek Riedewald, and Xiaofeng Yang. 2020. Optimal algorithms for ranked enumeration of answers to full conjunctive queries. Proc. VLDB Endow. 13, 9 (2020), 1582–1597. DOI:
[41]
Nikolaos Tziavelis, Wolfgang Gatterbauer, and Mirek Riedewald. 2020. Optimal join algorithms meet top-k. In SIGMOD. 2659–2665. DOI:
[42]
Nikolaos Tziavelis, Wolfgang Gatterbauer, and Mirek Riedewald. 2021. Beyond equi-joins: Ranking, enumeration and factorization. Proc. VLDB Endow. 14, 11 (2021), 2599–2612. DOI:
[43]
Nikolaos Tziavelis, Wolfgang Gatterbauer, and Mirek Riedewald. 2022. Any-k algorithms for enumerating ranked answers to conjunctive queries. CoRR abs/2205.05649 (2022).
[44]
Virginia Vassilevska Williams. 2015. Hardness of easy problems: Basing hardness on popular conjectures such as the strong exponential time hypothesis (invited talk). In IPEC. 17–29. DOI:
[45]
Xiaofeng Yang, Mirek Riedewald, Rundong Li, and Wolfgang Gatterbauer. 2018. Any-\(k\) algorithms for exploratory analysis with conjunctive queries. In ExploreDB. 1–3. DOI:
[46]
Mihalis Yannakakis. 1981. Algorithms for acyclic database schemes. In VLDB. 82–94. Retrieved from:.
[47]
Zhuoyue Zhao, Robert Christensen, Feifei Li, Xiao Hu, and Ke Yi. 2018. Random sampling over joins revisited. In SIGMOD. 1525–1539. DOI:

Cited By

View all
  • (2024)Ranked Enumeration for Database QueriesACM SIGMOD Record10.1145/3703922.370392453:3(6-19)Online publication date: 8-Nov-2024
  • (2024)Towards Tractability of the Diversity of Query Answers: Ultrametrics to the RescueProceedings of the ACM on Management of Data10.1145/36958332:5(1-26)Online publication date: 7-Nov-2024
  • (2024)Improved Approximation Algorithms for Relational ClusteringProceedings of the ACM on Management of Data10.1145/36958312:5(1-27)Online publication date: 7-Nov-2024

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Transactions on Database Systems
ACM Transactions on Database Systems  Volume 48, Issue 1
March 2023
112 pages
ISSN:0362-5915
EISSN:1557-4644
DOI:10.1145/3585397
Issue’s Table of Contents

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 13 March 2023
Online AM: 02 January 2023
Accepted: 14 November 2022
Revised: 07 December 2021
Received: 07 December 2021
Published in TODS Volume 48, Issue 1

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. Conjunctive queries
  2. direct access
  3. ranking function
  4. answer orderings
  5. query classification

Qualifiers

  • Research-article

Funding Sources

  • Google PhD Fellowships
  • German Research Foundation (DFG) Project
  • National Science Foundation (NSF)
  • French government under management of Agence Nationale de la Recherche as part of the “Investissements d’avenir” program

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)232
  • Downloads (Last 6 weeks)20
Reflects downloads up to 07 Mar 2025

Other Metrics

Citations

Cited By

View all
  • (2024)Ranked Enumeration for Database QueriesACM SIGMOD Record10.1145/3703922.370392453:3(6-19)Online publication date: 8-Nov-2024
  • (2024)Towards Tractability of the Diversity of Query Answers: Ultrametrics to the RescueProceedings of the ACM on Management of Data10.1145/36958332:5(1-26)Online publication date: 7-Nov-2024
  • (2024)Improved Approximation Algorithms for Relational ClusteringProceedings of the ACM on Management of Data10.1145/36958312:5(1-27)Online publication date: 7-Nov-2024
  • (2023)Efficient Computation of Quantiles over JoinsProceedings of the 42nd ACM SIGMOD-SIGACT-SIGAI Symposium on Principles of Database Systems10.1145/3584372.3588670(303-315)Online publication date: 18-Jun-2023
  • (2023)Cardinality estimation of activity trajectory similarity queries using deep learningInformation Sciences: an International Journal10.1016/j.ins.2023.119398646:COnline publication date: 1-Oct-2023

View Options

Login options

Full Access

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Full Text

View this article in Full Text.

Full Text

HTML Format

View this article in HTML Format.

HTML Format

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media