Query Optimization

We develop techniques for optimizing query evaluation over databases

In this research, we aim to develop techniques for optimizing query evaluation over databases of various types, from traditional relational models to ones entailed in text analytics. Our focus is on “compilation” techniques that translate queries into different formalisms that are associated with algorithms and complexity guarantees.

People

Publications

  1. A Formal Language Perspective on Factorized Representations

    Benny Kimelfeld, Wim Martens, Matthias Niewerth

    ICDT 2025

    Query Optimization

  2. Direct Access for Answers to Conjunctive Queries with Aggregation

    Idan Eldar, Nofar Carmeli, Benny Kimelfeld

    ICDT 2024

    Enumeration Algorithms Query Optimization

  3. Understanding Bulk-Bitwise Processing In-Memory Through Database Analytics

    Ben Perach, Ronny Ronen, Benny Kimelfeld, Shahar Kvatinsky

    IEEE Transactions on Emerging Topics in Computing 12(1): 7-22 (2024)

    Query Optimization

  4. Exploration of Knowledge Graphs via Online Aggregation

    Oren Kalinsky, Aidan Hogan, Oren Mishali, Yoav Etsion, Benny Kimelfeld

    ICDE 2022: 2695-2708

    Knowledge Bases Query Optimization

  5. Tractable Orders for Direct Access to Ranked Answers of Conjunctive Queries

    Nofar Carmeli, Nikolaos Tziavelis, Wolfgang Gatterbauer, Benny Kimelfeld, Mirek Riedewald

    PODS 2021: 325-341

    Enumeration Algorithms Query Optimization

  6. Answering (Unions of) Conjunctive Queries using Random Access and Random-Order Enumeration

    Nofar Carmeli, Shai Zeevi, Christoph Berkholz, Benny Kimelfeld, Nicole Schweikardt

    PODS 2020: 393-409

    Enumeration Algorithms Query Optimization

  7. On the Enumeration Complexity of Unions of Conjunctive Queries

    Nofar Carmeli, Markus Kröll

    PODS 2019: 134-148

    Enumeration Algorithms Query Optimization

  8. Enumeration Complexity of Conjunctive Queries with Functional Dependencies

    Nofar Carmeli, Markus Kröll

    ICDT 2018: 11:1-11:17

    Query Optimization Enumeration Algorithms

    Abstract

    We study the complexity of enumerating the answers of Conjunctive Queries (CQs) in the presence of Functional Dependencies (FDs). Our focus is on the ability to list output tuples with a constant delay in between, following a linear-time preprocessing. A known dichotomy classifies the acyclic self-join-free CQs into those that admit such enumeration, and those that do not. However, this classification no longer holds in the common case where the database exhibits dependencies among attributes. That is, some queries that are classified as hard are in fact tractable if dependencies are accounted for. We establish a generalization of the dichotomy to accommodate FDs; hence, our classification determines which combination of a CQ and a set of FDs admits constant-delay enumeration with a linear-time preprocessing. In addition, we generalize a hardness result for cyclic CQs to accommodate a common type of FDs. Further conclusions of our development include a dichotomy for enumeration with linear delay, and a dichotomy for CQs with disequalities. Finally, we show that all our results apply to the known class of “cardinality dependencies” that generalize FDs (e.g., by stating an upper bound on the number of genres per movies, or friends per person).

  9. Joining Extractions of Regular Expressions

    Dominik D. Freydenberger, Benny Kimelfeld, Liat Peterfreund

    PODS 2018: 137-149

    Text Analysis Query Optimization Enumeration Algorithms

    Abstract

    Regular expressions with capture variables, also known as “regex formulas,” extract relations of spans (interval positions) from text. These relations can be further manipulated via Relational Algebra as studied in the context of document spanners, Fagin et al.’s formal framework for information extraction. We investigate the complexity of querying text by Conjunctive Queries (CQs) and Unions of CQs (UCQs) on top of regex formulas. We show that the lower bounds (NPcompleteness and W[1]-hardness) from the relational world also hold in our setting; in particular, hardness hits already single-character text! Yet, the upper bounds from the relational world do not carry over. Unlike the relational world, acyclic CQs, and even gamma-acyclic CQs, are hard to compute. The source of hardness is that it may be intractable to instantiate the relation defined by a regex formula, simply because it has an exponential number of tuples. Yet, we are able to establish general upper bounds. In particular, UCQs can be evaluated with polynomial delay, provided that every CQ has a bounded number of atoms (while unions and projection can be arbitrary). Furthermore, UCQ evaluation is solvable with FPT (Fixed-Parameter Tractable) delay when the parameter is the size of the UCQ.

  10. Flexible Caching in Trie Joins

    Oren Kalinsky, Yoav Etsion, Benny Kimelfeld

    EDBT 2017: 282-293

    Query Optimization

    Abstract

    Traditional algorithms for multiway join computation are based on rewriting the order of joins and combining results of intermediate subqueries. Recently, several approaches have been proposed for algorithms that are “worst-case optimal” wherein all relations are scanned simultaneously. An example is Veldhuizen’s Leapfrog Trie Join (LFTJ). An important advantage of LFTJ is its small memory footprint, due to the fact that intermediate results are full tuples that can be dumped immediately. However, since the algorithm does not store intermediate results, recurring joins must be reconstructed from the source relations, resulting in excessive memory traffic. In this paper, we address this problem by incorporating caches into LFTJ. We do so by adopting recent developments on join optimization, tying variable ordering to tree decomposition. While the traditional usage of tree decomposition computes the result for each bag in advance, our proposed approach incorporates caching directly into LFTJ and can dynamically adjust the size of the cache. Consequently, our solution balances memory usage and repeated computation, as confirmed by our experiments over SNAP datasets.