DeepAI AI Chat
Log In Sign Up

Tractable Orders for Direct Access to Ranked Answers of Conjunctive Queries

by   Nofar Carmeli, et al.

We study the question of when we can provide logarithmic-time direct access to the k-th answer to a Conjunctive Query (CQ) with a specified ordering over the answers, following a preprocessing step that constructs a data structure in time quasilinear in the size of the database. Specifically, we embark on the challenge of identifying the tractable answer orderings that allow for ranked direct access with such complexity guarantees. We begin with lexicographic orderings and give a decidable characterization (under conventional complexity assumptions) of the class of tractable lexicographic orderings for every CQ without self-joins. We then continue to the more general orderings by the sum of attribute weights and show for it that ranked direct access is tractable only in trivial cases. Hence, to better understand the computational challenge at hand, we consider 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. We indeed achieve a quasilinear-time algorithm for a subset of the class of full CQs without self-joins, by adopting a solution of Frederickson and Johnson to the classic problem of selection over sorted matrices. We further prove that none of the other queries in this class admit such an algorithm.


page 1

page 2

page 3

page 4


Direct Access for Answers to Conjunctive Queries with Aggregation

We study the fine-grained complexity of conjunctive queries with groupin...

On the Enumeration Complexity of Unions of Conjunctive Queries

We study the enumeration complexity of Unions of Conjunctive Queries (UC...

Tight Fine-Grained Bounds for Direct Access on Join Queries

We consider the task of lexicographic direct access to query answers. Th...

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

As data analytics becomes more crucial to digital systems, so grows the ...

Efficient Computation of Quantiles over Joins

We present efficient algorithms for Quantile Join Queries, abbreviated a...

Any-k Algorithms for Enumerating Ranked Answers to Conjunctive Queries

We study ranked enumeration for Conjunctive Queries (CQs) where the answ...

Optimal Algorithms for Ranked Enumeration of Answers to Full Conjunctive Queries

We study ranked enumeration of the results to a join query in order of d...