arXiv:2610.01064cs.CLOct 2026Cited by 1 paper on PaperVantage

Manuscript Offprint

arXiv:2610.01064

JoinGR: Learning to Traverse Join Graphs for Table Retrieval

Sandipan De, Abhijit Chakraborty, Sambaran Bandyopadhyay, Vivek Gupta

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Retrieving the right tables is a prerequisite for Text-to-SQL over realistic databases. Dense table retrievers rank schema elements independently, but this ignores a key source of evidence: some required tables are not mentioned in the question and become identifiable only through their join relationships to already relevant tables. We introduce JOINGR, a join-aware table retrieval method that treats the database join graph as the retrieval space. Columns are represented as graph nodes, while intra-table and foreign-key relationships are represented as typed edges. Given a question, JOINGR selects semantically similar anchor tables, traverses join edges with a query-conditioned scorer, and aggregates the resulting edge deposits into table scores. The scorer is a lightweight MLP on top of frozen query, node, and edge embeddings, trained with a pairwise margin loss over gold tables. On BIRD and Spider datasets, JOINGR is competitive with the strongest retrieval baselines. On BEAVER, a challenging enterprise benchmark with multi-hop table requirements, JOINGR substantially improves recall over dense retrieval and re-ranking baselines. Cross-domain experiments show that the learned scorer transfers across benchmarks, indicating that the method captures reusable join-graph traversal behavior.

1 Introduction

Modern text-to-SQL systems increasingly rely on large language models to perform semantic parsing (Li et al., 2023; Pourreza and Rafiei, 2023). However, their success still depends on an upstream retrieval step: the model must have access to the schemas of the relevant table(s). In realistic databases, the full schema is often too large to place in context, and irrelevant schema elements can induce spurious joins or hallucinated SQL (Maamari et al., 2024). Conversely, if even one required table is missing from the retrieved context, the correct query may be impossible to generate. Table retrieval therefore narrows the schema before downstream schema linking and generation.

The dominant approach is dense retrieval. A question and schema elements are embedded into a shared vector space, and tables are ranked by semantic similarity to the question. This works well when schemas are compact, table and column names are descriptive, and when questions refer directly to the required tables. However, independent retrieval struggles when queries require multi-hop joins, or when table names are abbreviated, overlapping, or meaningful only in relation to other tables. A bag-of-columns retriever has no mechanism for expressing that a table becomes relevant only after another table has been selected.

We argue that this structural blindness, rather than embedding quality, is a key constraint. To make schema relationships first-class, we posit Join Graph: a graph representation in which columns are nodes and intra-table and foreign-key relationships are typed edges.

Structure alone is insufficient as it specifies table connections but not their relevance to specific questions. Different questions from the same anchor table may need different join edges. JOINGR combines semantic matching to select anchor tables and a query-conditioned scorer to determine relevance in the join graph. The scorer assigns weights to join edges, directing relevance flow along promising paths. Final table scores aggregate deposits from these query-specific walks. Figure 1 details the three-stage flow.

We evaluate JOINGR on Spider (Yu et al., 2018), BIRD (Li et al., 2023), and BEAVER (Chen et al., 2024a), spanning various retrieval difficulties. Spider offers a standard cross-domain setting where schemas are compact, and dense retrieval is strong. BIRD features larger databases, but many queries need only a few tables. BEAVER is a challenging enterprise benchmark with cryptic table names and

Q: What is the current building key, building street address, city, state, and postal code of the history department? Gold: ['FCLT_BUILDING_ADDRESS', 'FCLT_ROOMS', 'FCLT_ORG_DLC_KEY', 'MASTER_DEPT_HIERARCHY', 'BUILDINGS']

Figure

Figure 1: Overview of JOINGR table retrieval for the example question. (1) Semantic retrieval selects the top-5 anchor tables based on dense similarity between the query and table/column representations. (2) Starting from these anchors, JOINGR performs query-conditioned multi-hop traversal over the join graph; edge thickness indicates traversal probability and node size reflects aggregated deposit received during propagation. Gold tables are highlighted in orange. (3) Deposits accumulated from all traversal paths are aggregated to produce final table scores.

multi-hop table needs. This range lets us determine when structure-aware retrieval is needed: JOINGR should be competitive when semantic retrieval suffices and improve recall when relational structure is crucial.

Our results support this view. On Spider and BIRD, JOINGR is competitive with strong retrieval baselines in regimes where dense embedding similarity already performs well. On BEAVER, where independent retrieval and re-ranking methods struggle, JOINGR substantially improves recall and perfect recall. Moreover, scorers trained on one benchmark transfer to another without retraining, suggesting that the model learns to traverses join graphs rather than memorizing dataset-specific table names.

Our contributions are:

• We formulate table retrieval as query conditioned traversal over a database join graph, enabling retrieval of tables that are structurally implied rather than directly mentioned.

• We propose JOINGR, an anchor-walk-aggregate method that combines semantic retrieval with learned propagation over join relationships.

• We evaluate on Spider, BIRD, and BEAVER (DW), showing that JOINGR is competitive when dense retrieval is strong and substantially improves recall and perfect recall on multi-hop enterprise schemas.

• We show that the learned scorer transfers across benchmarks, supporting its use as a reusable traversal policy for new schemas with limited supervision.