---
title: 'Free-Connex Queries: Tractability Frontier'
url: https://www.emergentmind.com/topics/free-connex-queries
type: topic
---

# Free-Connex Queries: Tractability Frontier

Searching arXiv for recent and foundational papers on free-connex queries and closely related variants.
Free-connex queries are a structural class of conjunctive queries and related query formalisms in which acyclicity is preserved after adding one atom or hyperedge containing all free variables. In the classical conjunctive-query setting, this condition identifies the tractable frontier for several output-sensitive tasks: unranked enumeration with linear preprocessing and constant delay, ranked any-\(k\) enumeration with near-linear data complexity under suitable monotonicity assumptions, and linear-time counting for self-join-free acyclic queries under standard fine-grained assumptions [2205.05649] [2112.01108]. More recent work has generalized the same structural idea to join-aggregate queries, aggregate group-by queries, conjunctive regular path queries, dynamic maintenance, indexing, secure query processing, unions of conjunctive queries, and conjunctive queries with access patterns, while also clarifying where free-connexity remains exact, where it must be extended, and where it is superseded by richer structural notions [2406.05536] [2507.14101] [2512.11129] [2601.04757] [2603.14754] [2210.11996] [2206.09032].

## 1. Definition and structural characterization

A conjunctive query \(Q\) is presented as
\[
Q(\mathbf{Z}) \;:\!- \; R_1(\mathbf{X}_1), \ldots, R_\ell(\mathbf{X}_\ell),
\]
where the free variables are
\[
\mathbf{Z} = \bigcup_{i\in[\ell]} \mathbf{X}_i \setminus \mathbf{Y}
\]
for existential variables \(\mathbf{Y}\) [2205.05649]. Its hypergraph has variables as vertices and atoms as hyperedges. The query is acyclic if the hypergraph is \(\alpha\)-acyclic, equivalently if it admits a join tree satisfying the running intersection property [2205.05649].

The standard free-connex condition is that an acyclic query remains acyclic after adding one extra atom containing all free variables [2205.05649] [2406.05536] [2201.05129]. In the hypergraph notation used across the literature, if \(Q=(V,E,y)\) with output or free attributes \(y\), then \(Q\) is free-connex exactly when
\[
(V,E\cup\{y\},y)
\]
is also acyclic [2406.05536]. This same formulation is reused for join-aggregate queries and for rewriting problems over views, indicating that the notion is structurally stable across several semantics [2406.05536] [2201.05129].

An equivalent characterization central to algorithmic reductions is that free-connexity implies the existence of a join tree with a connected subset of nodes containing precisely the free variables and no existential ones [2205.05649]. In graph-shaped binary settings, the literature also formulates the obstruction negatively: an acyclic CQ is not free-connex exactly when it contains a free-path, namely a chordless path whose endpoints are free variables and whose internal vertices are bound [2210.11996] [1812.03831].

Several papers place free-connexity in a larger hierarchy. Every full acyclic CQ is trivially free-connex [2205.05649] [2406.05536]. Free-connexity is stronger than acyclicity but weaker than q-hierarchicality in dynamic settings [2206.09032]. In acyclic CRPQs, free-connexity is the width-\(1\) case of free-connex fractional hypertree width, while in acyclic join-aggregate queries it is the width-\(1\) case of out-width [2512.11129] [2406.05536]. In aggregate group-by queries, free-connex decompositions appear as the one-level special case of project-connex decompositions [2507.14101].

## 2. Classical tractability for enumeration and counting

For self-join-free conjunctive queries, free-connexity is the classical tractability criterion for linear-preprocessing, constant-delay enumeration. The unranked dichotomy, recalled and extended in later work, states that if \(Q\) is free-connex, then unranked enumeration is possible with
\[
TT(k)=O(n+k),
\]
where \(n\) is input size; otherwise, if \(Q\) is also self-join-free, such enumeration is not possible with
\[
TT(k)=O(n+k\,polylog\,k),
\]
assuming sparseBMM and Hyperclique [2205.05649].

The same structural boundary appears in counting. For self-join-free acyclic CQs, free-connexity is exactly the condition that permits linear-time counting; if a query is acyclic but not free-connex, then under the assumption that SAT has no algorithm with runtime \(O(2^{n(1-\epsilon)})\) for any \(\epsilon>0\), there is no algorithm counting answers in time \(O(m^{2-\epsilon'})\) for any \(\epsilon'>0\), where \(m\) is the number of tuples in the database [2112.01108]. More generally, quantified star size lower-bounds the counting exponent, and free-connex acyclic queries are exactly the quantified-star-size-\(1\) case [2112.01108].

Free-connexity also governs stronger indexability notions. For ordinary CQs, free-connex acyclic queries admit linear preprocessing together with constant-delay enumeration, logarithmic-time random access, constant-time inverted access, and therefore random-order enumeration through a lazy Fisher–Yates shuffle [1912.10704]. For self-join-free CQs, the same paper uses prior hardness results to conclude that every non-free-connex query is intractable for enumeration, random-order enumeration, and random access under sparse-BMM, Triangle, and Hyperclique [1912.10704].

These results collectively establish the classical picture: once existential variables disconnect the free variables, acyclic join structure alone no longer suffices for output-sensitive processing.

## 3. Ranked and any-\(k\) enumeration

Free-connexity continues to define the tractable frontier when answer ordering is introduced. For ranked enumeration under min-weight-projection semantics, the paper "Any-k Algorithms for Enumerating Ranked Answers to Conjunctive Queries" shows that the ranked analogue of the unranked dichotomy preserves the same structural boundary [2205.05649].

The query answers are ranked by an aggregate ranking function \(w_A\) composed with tuple weights. For projected CQs, the paper adopts min-weight-projection semantics:
\[
w(q) = \min_{(t_1,\ldots,t_\ell)\in wit(q)} w_A(\{w_I(t_i)\mid i\in[\ell]\}).
\]
Under this semantics, naively enumerating the full CQ and projecting afterward can delay distinct projected answers by \(\Theta(r)\) duplicates, so free-connexity is used to compile away existential branches while preserving ranked order [2205.05649].

The main ranked dichotomy states that if \(Q\) is free-connex, then ranked enumeration with an s-monotone ranking function is possible with
\[
TT(k)=O(n+k\log k), \qquad MEM(k)=O(n+k).
\]
If \(Q\) is not free-connex and is self-join-free, then the same near-linear bound is conditionally impossible under sparseBMM and Hyperclique [2205.05649]. The free-connex condition is therefore still necessary and sufficient in data complexity.

The ranking-side assumptions are expressed via subset-monotonicity and strong-subset-monotonicity:
\[
w_A(Y_1)\preceq w_A(Y_2) \Rightarrow w_A(X\uplus Y_1)\preceq w_A(X\uplus Y_2),
\]
and
\[
w_A(X_1\uplus Y_1)\preceq w_A(X_1\uplus Y_2)\;\wedge\; w_A(X_1)\preceq w_A(X_2)
\Rightarrow
w_A(X_2\uplus Y_1)\preceq w_A(X_2\uplus Y_2).
\]
These properties make it possible to push ranking into the join via dynamic programming and deviation-based successor generation rather than materializing all answers first [2205.05649].

Algorithmically, the free-connex reduction turns a projected ranked CQ into a full acyclic CQ on a linear-size transformed database by using the connected subset of free-variable nodes in a join tree and absorbing the best completion cost of pruned existential branches into weighted terminal edges [2205.05649]. This reduction is then combined with three any-\(k\) algorithms—anyK-part, anyK-rec, and anyK-part+—whose tradeoffs are resolved asymptotically by anyK-part+ under strong-subset-monotonicity [2205.05649].

## 4. Aggregate, semiring, and group-by generalizations

Free-connexity remains central when joins are combined with aggregation. For acyclic join-aggregate queries over commutative semirings, the classical Yannakakis framework gives output-optimal
\[
O(N+\OUT)
\]
time exactly for free-connex queries, where \(N\) is input size and \(\OUT\) is output size [2406.05536]. The 2024 output-sensitive theory generalizes this with a width parameter \(outw(Q)\), proving matching upper and lower bounds
\[
\Theta\!\left(N\cdot \OUT^{1-\frac1{outw}}+\OUT\right),
\]
and showing
\[
outw(Q)=1 \iff Q \text{ is free-connex}
\]
for acyclic queries [2406.05536]. Thus free-connex queries are exactly the width-\(1\) case and exactly the case where the general bound collapses to the classical \(O(N+\OUT)\) regime [2406.05536].

The aggregate group-by setting pushes this further. Project-connex decompositions are introduced as the natural extension of free-connex decompositions to nested projection and aggregation:
\[
\gamma = \pi_{X_n}^{\oplus_n}\dotsb \pi_{X_1}^{\oplus_1}{\Join^\otimes} q.
\]
A tree decomposition is project-connex if it contains nested witness subtrees \(T_n\subseteq \cdots \subseteq T_1\) whose bag unions are exactly the projection sets \(X_n,\dots,X_1\) [2507.14101]. In the one-level case, this reduces exactly to free-connexness. The paper shows that project-connex generalized hyperwidth is equal to the generalized hyperwidth of an augmented query, making project-connex decompositions computable through classical decomposition algorithms [2507.14101].

This framework recovers and unifies older free-connex results. In particular, bounded free-connex width of the core of a counting CQ is equivalent to the classical tractability characterization for counting under bounded arity:
\[
\evalPb{\counting{C}\in \textsf{PTime} \iff \fghw(\core(C))\text{ is bounded}
\]
for recursively enumerable bounded-arity classes \(C\), assuming \(\textsf{FPT}\ne \textsf{W}[1]\) [2507.14101]. A plausible implication is that free-connexness is not merely one tractable case among many, but a canonical interface through which counting, enumeration, and semiring aggregation can be understood uniformly.

Free-connexity also appears in secure multi-party computation. The LINQ protocol supports all free-connex select-join-aggregate queries with
\[
O(n+m)
\]
running time and communication in a semi-honest 3PC model, where \(n\) is input size and \(m\) is output size [2403.13492]. The protocol explicitly mirrors the plaintext free-connex frontier by realizing a secure Yannakakis/AJAR-style plan over a free-connex join tree, thereby matching the largest query class currently known to admit linear-time evaluation in plaintext [2403.13492].

## 5. Extensions to CRPQs, UCQs, rewriting, and indexing

Free-connexity has been extended far beyond ordinary CQs.

For acyclic CRPQs, free-connex fractional hypertree width \(fn\text{-}fhtw(Q)\) is the width-\(1\) case:
\[
fn\text{-}fhtw(Q)=1 \iff Q \text{ is free-connex},
\]
and the 2025 result on acyclic CRPQs shows that output-sensitive complexity is governed by \(\max(fn\text{-}fhtw(Q),2)\), with runtime
\[
O\!\left(N + N\cdot OUT^{1-\frac{1}{\max(fn\text{-}fhtw(Q), 2)}}+OUT\right)
\]
[2512.11129]. The same paper emphasizes that recursion does not create additional output-sensitive complexity beyond the corresponding acyclic CQ structure [2512.11129]. A complementary 2025 CRPQ result uses free-connexity as a target normal form: general acyclic CRPQs are contracted into free-connex acyclic ones by eliminating bound variables through RPQ composition or promotion, yielding a free-connex-based output-sensitive pipeline [2509.20204].

For unions of conjunctive queries, free-connexity must be generalized. A union may be tractable even if one or all disjuncts are individually intractable, because one CQ can provide auxiliary variable combinations for another [1812.03831]. The relevant notion is a free-connex union extension, where virtual atoms supplied by one disjunct are added to another so that every difficult CQ in the union becomes free-connex [1812.03831] [2210.11996]. For unions of two self-join-free CQs, the 2022 paper identifies a dichotomy under the vertex-unbalanced triangle detection hypothesis: a union is tractable exactly when it has a free-connex union extension [2210.11996]. Thus plain free-connexity of each constituent CQ is no longer sufficient as a classification principle; it survives only through the union-extension generalization.

In the rewriting problem, free-connexness behaves as a preservation property. If a query \(Q\) is free-connex acyclic and has any rewriting over a set of views, then it has a free-connex acyclic rewriting [2201.05129]. On the complexity side, bounded-arity acyclic rewriting remains NP-hard when the views are merely acyclic or hierarchical, but becomes tractable when the views are free-connex acyclic:
\[
\rewrprobk{\CCQ}{\ACQ}{\ACQ}\in \classP
\]
[2201.05129]. This is one of the clearest demonstrations that the head-connectedness encoded by free-connexness is algorithmically decisive even when only the views, rather than the input query, are structurally restricted.

Database indexing introduces yet another angle. The 2026 structural indexing result constructs, for a fixed database \(D\), a color-refinement-based auxiliary database \(D_{\mathrm{col}}\) such that every later free-connex acyclic CQ can be counted or enumerated with preprocessing proportional to \(|D_{\mathrm{col}}|\) rather than \(|D|\) [2601.04757]. The core theorem states that after \(O(|D|\log|D|)\) indexing time, every Boolean acyclic query can be answered in \(O(|Q|\cdot |D_{\mathrm{col}}|)\), and every \(Q\in \fcACQ\) can be enumerated with delay \(O(|\free(Q)|)\) after \(O(|Q|\cdot |D_{\mathrm{col}}|)\) preprocessing [2601.04757]. This suggests that free-connexity is also the right query-side condition for exploiting structural symmetries in the data via quotient-like indexes.

## 6. Dynamic, access-pattern, and parameterized perspectives

Dynamic maintenance reveals a limitation of free-connexity as a complete tractability notion. In static evaluation and insertion-only updates, free-connex queries remain easy, but under mixed insertions and deletions the class is far from uniform [2603.14754]. The 2026 parameterized hardness paper introduces height \(k\) and dimension \(d\) and proves that even free-connex queries can require amortized update time
\[
\Omega\!\left(|D|^{\,1-1/\max(k,d)-\varepsilon}\right)
\]
under standard conjectures [2603.14754]. Star queries are the canonical example: they are free-connex and height \(2\), yet dimension \(d\) can be arbitrarily large, yielding update lower bounds approaching linear [2603.14754]. A plausible implication is that free-connexity is a static tractability frontier but not a sufficient dynamic invariant beyond the q-hierarchical subclass.

This picture is sharpened further in conjunctive queries with free access patterns. There, the relevant object is not free-connexity but the fracture of the query together with access-top variable orders, free-dominance, and input-dominance [2206.09032]. The paper explicitly states that its general width theorem recovers known results for free-connex acyclic queries—linear preprocessing, linear update, constant delay—but the exact dynamic constant-update/constant-delay frontier is a stricter class, CQAP\(_0\), and not a free-connex analogue [2206.09032]. In the no-input case, the tractable dynamic fragment collapses to q-hierarchical queries, not to free-connex queries [2206.09032].

Finally, the MATLANG correspondence shows that free-connexity has an expressive counterpart in sparse linear algebra. Binary free-connex CQs are exactly the \(\mathrm{FO}^\wedge_2\) queries, and these are exactly the \(fc\)-MATLANG fragment in which matrix multiplication is allowed only when one factor is a row or column vector [2310.04118]. Over semi-integral domains, this yields linear-time preprocessing and constant-delay enumeration for the nonzero output entries of the corresponding sparse linear algebra programs [2310.04118]. Thus free-connexity is not merely a database-theoretic artifact; it identifies a structurally tractable fragment across two-variable logic and linear algebra query languages.

## 7. Conceptual significance and limitations

Free-connexity is best understood as the condition that the free-variable interface can be embedded into an acyclic decomposition without being separated by existential structure. That interpretation explains why it repeatedly appears as the exact tractable frontier for output-sensitive tasks centered on the free variables: enumeration, random access, ranked projection, counting, and output-optimal grouped aggregation [2205.05649] [2112.01108] [1912.10704] [2406.05536]. It also explains why the same idea must be generalized when the interface becomes more elaborate, as in nested group-by (project-connex), UCQ disjunction (free-connex union extensions), or CRPQ contraction (free-connex targets after elimination and promotion) [2507.14101] [1812.03831] [2509.20204].

At the same time, free-connexity is not universal. Dynamic maintenance under deletions requires finer structure, such as q-hierarchicality, height, and dimension [2603.14754] [2206.09032]. In UCQs, tractability is not determined CQ-by-CQ and may depend on whether difficult structures are guarded or provided by other disjuncts [2210.11996]. In aggregate settings, free-connexness is only the width-\(1\) base case of broader quantitative hierarchies such as out-width or project-connex width [2406.05536] [2507.14101].

The cumulative literature therefore supports a stable synthesis. Free-connexity is the canonical structural notion for the tractability of projected outputs in acyclic query processing. It remains exact for several core tasks, survives as the width-\(1\) case of more general theories, and frequently serves as the normal form to which harder query classes are reduced. Where it fails to be exact, the reason is typically not that the notion becomes irrelevant, but that the query model introduces additional interfaces—disjunction, recursion, nested aggregation, updates, or access asymmetry—that require a strictly richer version of the same connectivity principle.

Source: https://www.emergentmind.com/topics/free-connex-queries