Papers
Topics
Authors
Recent
Gemini 2.5 Flash
Gemini 2.5 Flash
129 tokens/sec
GPT-4o
28 tokens/sec
Gemini 2.5 Pro Pro
42 tokens/sec
o3 Pro
4 tokens/sec
GPT-4.1 Pro
38 tokens/sec
DeepSeek R1 via Azure Pro
28 tokens/sec
2000 character limit reached

Insert-Only versus Insert-Delete in Dynamic Query Evaluation (2312.09331v5)

Published 14 Dec 2023 in cs.DB

Abstract: We study the dynamic query evaluation problem: Given a full conjunctive query Q and a sequence of updates to the input database, we construct a data structure that supports constant-delay enumeration of the tuples in the query output after each update. We show that a sequence of N insert-only updates to an initially empty database can be executed in total time O(Nw(Q)), where w(Q) is the fractional hypertree width of Q. This matches the complexity of the static query evaluation problem for Q and a database of size N. One corollary is that the amortized time per single-tuple insert is constant for acyclic full conjunctive queries. In contrast, we show that a sequence of N inserts and deletes can be executed in total time O(Nw(Q')), where Q' is obtained from Q by extending every relational atom with extra variables that represent the "lifespans" of tuples in the database. We show that this reduction is optimal in the sense that the static evaluation runtime of Q' provides a lower bound on the total update time for the output of Q. Our approach achieves amortized optimal update times for the hierarchical and Loomis-Whitney join queries.

Definition Search Book Streamline Icon: https://streamlinehq.com
References (42)
  1. Foundations of Differential Dataflow. In Foundations of Software Science and Computation Structures - 18th International Conference, FoSSaCS 2015, Held as Part of the European Joint Conferences on Theory and Practice of Software, ETAPS 2015, London, UK, April 11-18, 2015. Proceedings (Lecture Notes in Computer Science, Vol. 9034), Andrew M. Pitts (Ed.). Springer, 71–83. https://doi.org/10.1007/978-3-662-46678-0_5
  2. FAQ: Questions Asked Frequently. In Proceedings of the 35th ACM SIGMOD-SIGACT-SIGAI Symposium on Principles of Database Systems (San Francisco, California, USA) (PODS ’16). Association for Computing Machinery, New York, NY, USA, 13–28. https://doi.org/10.1145/2902251.2902280
  3. What Do Shannon-Type Inequalities, Submodular Width, and Disjunctive Datalog Have to Do with One Another?. In Proceedings of the 36th ACM SIGMOD-SIGACT-SIGAI Symposium on Principles of Database Systems (Chicago, Illinois, USA) (PODS ’17). Association for Computing Machinery, New York, NY, USA, 429–444. https://doi.org/10.1145/3034786.3056105
  4. Size Bounds and Query Plans for Relational Joins. SIAM J. Comput. 42, 4 (2013), 1737–1767. https://doi.org/10.1109/FOCS.2008.43
  5. Answering Conjunctive Queries Under Updates. In PODS. 303–318. DOI: 10.1145/3034786.3034789.
  6. Johann Brault-Baron. 2016. Hypergraph Acyclicity Revisited. ACM Comput. Surv. 49, 3 (2016), 54:1–54:26. https://doi.org/10.1145/2983573
  7. DBSP: Automatic Incremental View Maintenance for Rich Query Languages. Proc. VLDB Endow. 16, 7 (2023), 1601–1614. https://doi.org/10.14778/3587136.3587137
  8. Reachability is in DynFO. In Automata, Languages, and Programming - 42nd International Colloquium, ICALP 2015, Kyoto, Japan, July 6-10, 2015, Proceedings, Part II (Lecture Notes in Computer Science, Vol. 9135), Magnús M. Halldórsson, Kazuo Iwama, Naoki Kobayashi, and Bettina Speckmann (Eds.). Springer, 159–170. https://doi.org/10.1007/978-3-662-47666-6_13
  9. Reachability Is in DynFO. J. ACM 65, 5 (2018), 33:1–33:24. https://doi.org/10.1145/3212685
  10. Arnaud Durand and Etienne Grandjean. 2007. First-order Queries on Structures of Bounded Degree are Computable with Constant Delay. TOCL 8, 4 (2007), 21.
  11. Unifying and Strengthening Hardness for Dynamic Problems via the Online Matrix-Vector Multiplication Conjecture. In Proceedings of the Forty-Seventh Annual ACM on Symposium on Theory of Computing, STOC 2015, Portland, OR, USA, June 14-17, 2015, Rocco A. Servedio and Ronitt Rubinfeld (Eds.). ACM, 21–30. https://doi.org/10.1145/2746539.2746609
  12. The Dynamic Yannakakis Algorithm: Compact and Efficient Query Processing Under Updates. In Proceedings of the 2017 ACM International Conference on Management of Data, SIGMOD Conference 2017, Chicago, IL, USA, May 14-19, 2017, Semih Salihoglu, Wenchao Zhou, Rada Chirkova, Jun Yang, and Dan Suciu (Eds.). 1259–1274. https://doi.org/10.1145/3035918.3064027
  13. General dynamic Yannakakis: conjunctive queries with theta joins under updates. VLDB J. 29, 2-3 (2020), 619–653. https://doi.org/10.1007/S00778-019-00590-9
  14. Christian S. Jensen and Richard T. Snodgrass. 2018. Temporal Database. In Encyclopedia of Database Systems, Second Edition, Ling Liu and M. Tamer Özsu (Eds.). Springer. https://doi.org/10.1007/978-1-4614-8265-9_395
  15. Counting Triangles under Updates in Worst-Case Optimal Time. In 22nd International Conference on Database Theory, ICDT 2019, March 26-28, 2019, Lisbon, Portugal (LIPIcs, Vol. 127), Pablo Barceló and Marco Calautti (Eds.). Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 4:1–4:18. https://doi.org/10.4230/LIPICS.ICDT.2019.4
  16. Maintaining Triangle Queries under Updates. ACM Trans. Database Syst. 45, 3 (2020), 11:1–11:46. https://doi.org/10.1145/3396375
  17. Trade-offs in Static and Dynamic Evaluation of Hierarchical Queries. In Proceedings of the 39th ACM SIGMOD-SIGACT-SIGAI Symposium on Principles of Database Systems, PODS 2020, Portland, OR, USA, June 14-19, 2020, Dan Suciu, Yufei Tao, and Zhewei Wei (Eds.). ACM, 375–392. https://doi.org/10.1145/3375395.3387646
  18. Conjunctive Queries with Free Access Patterns Under Updates. In 26th International Conference on Database Theory, ICDT 2023, March 28-31, 2023, Ioannina, Greece (LIPIcs, Vol. 255), Floris Geerts and Brecht Vandevoort (Eds.). Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 17:1–17:20. https://doi.org/10.4230/LIPICS.ICDT.2023.17
  19. F-IVM: analytics over relational databases under updates. The VLDB Journal (2023). https://doi.org/10.1007/s00778-023-00817-w
  20. Trade-offs in Static and Dynamic Evaluation of Hierarchical Queries. Log. Methods Comput. Sci. 19, 3 (2023). https://doi.org/10.46298/LMCS-19(3:11)2023
  21. The Complexity of Boolean Conjunctive Queries with Intersection Joins. In PODS. ACM, 53–65. https://doi.org/10.1145/3517804.3524156
  22. Christoph Koch. 2010. Incremental query evaluation in a ring of databases. In Proceedings of the Twenty-Ninth ACM SIGMOD-SIGACT-SIGART Symposium on Principles of Database Systems, PODS 2010, June 6-11, 2010, Indianapolis, Indiana, USA, Jan Paredaens and Dirk Van Gucht (Eds.). ACM, 87–98. https://doi.org/10.1145/1807085.1807100
  23. DBToaster: higher-order delta processing for dynamic, frequently fresh views. VLDB J. 23, 2 (2014), 253–278. https://doi.org/10.1007/S00778-013-0348-4
  24. Incremental View Maintenance For Collection Programming. In Proceedings of the 35th ACM SIGMOD-SIGACT-SIGAI Symposium on Principles of Database Systems, PODS 2016, San Francisco, CA, USA, June 26 - July 01, 2016, Tova Milo and Wang-Chiew Tan (Eds.). ACM, 75–90. https://doi.org/10.1145/2902251.2902286
  25. L. H. Loomis and H. Whitney. 1949. An inequality related to the isoperimetric inequality. Journal: Bull. Amer. Math. Soc. 55, 55 (1949), 961–962. DOI: 10.1090/S0002-9904-1949-09320-5.
  26. Dániel Marx. 2013. Tractable Hypergraph Properties for Constraint Satisfaction and Conjunctive Queries. J. ACM 60, 6, Article 42 (nov 2013), 51 pages. https://doi.org/10.1145/2535926
  27. Maintenance of datalog materialisations revisited. Artif. Intell. 269 (2019), 76–136. https://doi.org/10.1016/J.ARTINT.2018.12.004
  28. Hung Q. Ngo. 2018. Worst-Case Optimal Join Algorithms: Techniques, Results, and Open Problems. In Proceedings of the 37th ACM SIGMOD-SIGACT-SIGAI Symposium on Principles of Database Systems (Houston, TX, USA) (PODS ’18). Association for Computing Machinery, New York, NY, USA, 111–124. https://doi.org/10.1145/3196959.3196990
  29. Worst-case Optimal Join Algorithms. J. ACM 65, 3 (2018), 16:1–16:40. https://doi.org/10.1145/2213556.2213565
  30. Skew Strikes Back: New Developments in the Theory of Join Algorithms. SIGMOD Rec. 42, 4 (feb 2014), 5–16. https://doi.org/10.1145/2590989.2590991
  31. LINVIEW: incremental view maintenance for complex analytical queries. In International Conference on Management of Data, SIGMOD 2014, Snowbird, UT, USA, June 22-27, 2014, Curtis E. Dyreson, Feifei Li, and M. Tamer Özsu (Eds.). ACM, 253–264. https://doi.org/10.1145/2588555.2610519
  32. Milos Nikolic and Dan Olteanu. 2018. Incremental View Maintenance with Triple Lock Factorization Benefits. In Proceedings of the 2018 International Conference on Management of Data, SIGMOD Conference 2018, Houston, TX, USA, June 10-15, 2018, Gautam Das, Christopher M. Jermaine, and Philip A. Bernstein (Eds.). ACM, 365–380. https://doi.org/10.1145/3183713.3183758
  33. F-IVM: Learning over Fast-Evolving Relational Data. In Proceedings of the 2020 International Conference on Management of Data, SIGMOD Conference 2020, online conference [Portland, OR, USA], June 14-19, 2020, David Maier, Rachel Pottinger, AnHai Doan, Wang-Chiew Tan, Abdussalam Alawini, and Hung Q. Ngo (Eds.). ACM, 2773–2776. https://doi.org/10.1145/3318464.3384702
  34. Mihai Patrascu. 2010. Towards Polynomial Lower Bounds for Dynamic Problems. In Proceedings of the Forty-Second ACM Symposium on Theory of Computing (Cambridge, Massachusetts, USA) (STOC ’10). Association for Computing Machinery, New York, NY, USA, 603–610. https://doi.org/10.1145/1806689.1806772
  35. Sketches of Dynamic Complexity. SIGMOD Rec. 49, 2 (2020), 18–29. https://doi.org/10.1145/3442322.3442325
  36. Probabilistic Databases. Morgan & Claypool Publishers. https://doi.org/10.2200/S00362ED1V01Y201105DTM016
  37. Yufei Tao and Ke Yi. 2022. Intersection joins under updates. J. Comput. Syst. Sci. 124 (2022), 41–64. https://doi.org/10.1016/J.JCSS.2021.09.004
  38. Todd L. Veldhuizen. 2014. Triejoin: A Simple, Worst-Case Optimal Join Algorithm. In Proc. 17th International Conference on Database Theory (ICDT), Athens, Greece, March 24-28, 2014, Nicole Schweikardt, Vassilis Christophides, and Vincent Leroy (Eds.). OpenProceedings.org, 96–106. https://doi.org/10.5441/002/ICDT.2014.13
  39. Change Propagation Without Joins. Proc. VLDB Endow. 16, 5 (2023), 1046–1058. https://doi.org/10.14778/3579075.3579080
  40. Qichen Wang and Ke Yi. 2020. Maintaining Acyclic Foreign-Key Joins under Updates. In Proceedings of the 2020 International Conference on Management of Data, SIGMOD Conference 2020, online conference [Portland, OR, USA], June 14-19, 2020, David Maier, Rachel Pottinger, AnHai Doan, Wang-Chiew Tan, Abdussalam Alawini, and Hung Q. Ngo (Eds.). ACM, 1225–1239. https://doi.org/10.1145/3318464.3380586
  41. Mihalis Yannakakis. 1981. Algorithms for Acyclic Database Schemes. In Proceedings of the Seventh International Conference on Very Large Data Bases - Volume 7 (Cannes, France) (VLDB ’81). VLDB Endowment, 82–94.
  42. C.T. Yu and M.Z. Ozsoyoglu. 1979. An algorithm for tree-query membership of a distributed query. , 306-312 pages. https://doi.org/10.1109/CMPSAC.1979.762509
Citations (2)

Summary

We haven't generated a summary for this paper yet.