JoinGR improves table retrieval using join graph traversal
JoinGR: Learning to Traverse Join Graphs for Table Retrieval
Computation and LanguageArtificial IntelligenceDatabasesInformation Retrieval
Summary
Finding the right tables in a database is crucial for answering questions using SQL. Typical methods look at each table separately, missing important connections between tables that are linked by database joins. The authors introduce JoinGR, which views tables and their relations as a graph and navigates this graph to find relevant tables based on the question asked. This method works well on several benchmarks and especially helps with complex queries requiring multiple related tables. The approach also generalizes well across different datasets.
What this means in practice
- •For enterprise data teams: Improve retrieval of relevant tables across complex database schemas for multi-table SQL query generation in business environments.
- •For software engineers: Build question-driven database query systems that can navigate join relationships to access hidden but relevant tables automatically.
Authors
Sandipan De, Abhijit Chakraborty, Sambaran Bandyopadhyay, Vivek Gupta
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 joingraph traversal behavior.