Ehsan Jahanbakhsh Bashirloo
2026
SchemaGraphSQL: Efficient Schema Linking with Pathfinding Graph Algorithms for Text-to-SQL on Large-Scale Databases
AmirHossein Safdarian | Milad Mohammadi | Ehsan Jahanbakhsh Bashirloo | Mona Shahamat Naderi | Heshaam Faili
Findings of the Association for Computational Linguistics: EACL 2026
AmirHossein Safdarian | Milad Mohammadi | Ehsan Jahanbakhsh Bashirloo | Mona Shahamat Naderi | Heshaam Faili
Findings of the Association for Computational Linguistics: EACL 2026
Text-to-SQL systems translate natural language questions into executable SQL queries, and recent progress with large language models (LLMs) has driven substantial improvements in this task. Schema linking remains a critical component in Text-to-SQL systems, reducing prompt size for models with narrow context windows and sharpening model focus even when the entire schema fits. We present a zero-shot, training-free schema linking approach that first constructs a schema graph based on foreign key relations, then uses a single prompt to a lightweight LLM to extract source and destination tables from the user query, followed by applying classical path-finding algorithms and post-processing to identify the optimal sequence of tables and columns that should be joined, enabling the LLM to generate more accurate SQL queries. To handle real-world databases where foreign keys may be missing or inconsistent, we further propose an LLM-guided joinability discovery step that infers table connections before graph construction, ensuring robustness across diverse schemas. Despite being simple, cost-effective, and highly scalable, our method achieves state-of-the-art results on both the BIRD and Spider 2.0 benchmarks, outperforming previous specialized, fine-tuned, and complex multi-step LLM-based approaches.