MDB-Link: Hierarchical Schema Linking for Multi-Database Text-to-SQL

2026-08-10Computation and Language

Computation and Language
AI summary

The authors address a problem where a system must find the right database among many before making a SQL query. They created MDB-Link, a method that first narrows down relevant parts of databases, then picks the best database and schema parts using a smart language model. Their method is better and faster than previous ones on several tests, making it easier to generate accurate SQL queries across multiple databases. MDB-Link also keeps the selected schema size close to the ideal, which helps in efficient query generation.

Text-to-SQLschema linkingmulti-databaseSQL generationlarge language modeldatabase localizationschema subsethierarchical retrievalcolumn selection
Authors
Beiyu Xu, Zhenyu Wu, Jiaoyan Chen, Riza theresa Batista-navarro
Abstract
Traditional Text-to-SQL research and benchmarks assume a known target database, overlooking settings in which a query must be routed within a large, heterogeneous database collection. We therefore study schema linking in a multi-database setting, where the system must first locate the target database and then construct a compact, SQL-relevant schema for generation. We propose MDB-Link, a hierarchical schema-linking framework that retrieves question-relevant columns from a global index, aggregates retrieval evidence to shortlist databases, and uses a budget-aware large language model (LLM) for database reranking, table selection, and column grounding. With Qwen2.5-14B, MDB-Link outperforms LinkAlign on MMQA, Spider2-Snow, and BIRD-dev in database localization and column selection while producing schema subsets close in size to the gold schemas. Exact match improves from 16.88 to 51.41 on MMQA, 2.50 to 9.17 on Spider2-Snow, and 12.52 to 38.01 on BIRD-dev. MDB-Link also runs faster than LinkAlign and AutoLink, demonstrating the effectiveness of hierarchical schema reduction for downstream SQL generation.