TailorSQL: An NL2SQL System Tailored to Your Query Workload

Fuente: arXiv
Gespeichert in:
Bibliographische Detailangaben
Hauptverfasser: Vaidya, Kapil, Ding, Jialin, Kosak, Sebastian, Kernert, David, Lei, Chuan, Qin, Xiao, Tripathy, Abhinav, Balan, Ramesh, Narayanaswamy, Balakrishnan, Kraska, Tim
Format: Preprint
Veröffentlicht: 2025
Schlagworte:
Online-Zugang:
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
_version_ 1866915311835414528
author Vaidya, Kapil
Ding, Jialin
Kosak, Sebastian
Kernert, David
Lei, Chuan
Qin, Xiao
Tripathy, Abhinav
Balan, Ramesh
Narayanaswamy, Balakrishnan
Kraska, Tim
author_facet Vaidya, Kapil
Ding, Jialin
Kosak, Sebastian
Kernert, David
Lei, Chuan
Qin, Xiao
Tripathy, Abhinav
Balan, Ramesh
Narayanaswamy, Balakrishnan
Kraska, Tim
contents NL2SQL (natural language to SQL) translates natural language questions into SQL queries, thereby making structured data accessible to non-technical users, serving as the foundation for intelligent data applications. State-of-the-art NL2SQL techniques typically perform translation by retrieving database-specific information, such as the database schema, and invoking a pre-trained large language model (LLM) using the question and retrieved information to generate the SQL query. However, existing NL2SQL techniques miss a key opportunity which is present in real-world settings: NL2SQL is typically applied on existing databases which have already served many SQL queries in the past. The past query workload implicitly contains information which is helpful for accurate NL2SQL translation and is not apparent from the database schema alone, such as common join paths and the semantics of obscurely-named tables and columns. We introduce TailorSQL, a NL2SQL system that takes advantage of information in the past query workload to improve both the accuracy and latency of translating natural language questions into SQL. By specializing to a given workload, TailorSQL achieves up to 2$\times$ improvement in execution accuracy on standardized benchmarks.
format Preprint
id arxiv_https___arxiv_org_abs_2505_23039
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle TailorSQL: An NL2SQL System Tailored to Your Query Workload
Vaidya, Kapil
Ding, Jialin
Kosak, Sebastian
Kernert, David
Lei, Chuan
Qin, Xiao
Tripathy, Abhinav
Balan, Ramesh
Narayanaswamy, Balakrishnan
Kraska, Tim
Databases
Computation and Language
NL2SQL (natural language to SQL) translates natural language questions into SQL queries, thereby making structured data accessible to non-technical users, serving as the foundation for intelligent data applications. State-of-the-art NL2SQL techniques typically perform translation by retrieving database-specific information, such as the database schema, and invoking a pre-trained large language model (LLM) using the question and retrieved information to generate the SQL query. However, existing NL2SQL techniques miss a key opportunity which is present in real-world settings: NL2SQL is typically applied on existing databases which have already served many SQL queries in the past. The past query workload implicitly contains information which is helpful for accurate NL2SQL translation and is not apparent from the database schema alone, such as common join paths and the semantics of obscurely-named tables and columns. We introduce TailorSQL, a NL2SQL system that takes advantage of information in the past query workload to improve both the accuracy and latency of translating natural language questions into SQL. By specializing to a given workload, TailorSQL achieves up to 2$\times$ improvement in execution accuracy on standardized benchmarks.
title TailorSQL: An NL2SQL System Tailored to Your Query Workload
topic Databases
Computation and Language
url https://arxiv.org/abs/2505.23039