title: Speculative Ad-hoc Querying
summary: Analyzing large datasets requires responsive query execution, but executing
  SQL queries on massive datasets can be slow. This paper explores whether query
  execution can begin even before the user has finished typing, allowing results
  to appear almost instantly. We propose SpeQL, a system that leverages Large
  Language Models (LLMs) to predict likely queries based on the database schema,
  the user's past queries, and their incomplete query. Since exact query
  prediction is infeasible, SpeQL speculates on partial queries in two ways: 1)
  it predicts the query structure to compile and plan queries in advance, and 2)
  it precomputes smaller temporary tables that are much smaller than the original
  database, but are still predicted to contain all information necessary to
  answer the user's final query. Additionally, SpeQL continuously displays
  results for speculated queries and subqueries in real time, aiding exploratory
  analysis. A utility/user study showed that SpeQL improved task completion time,
  and participants reported that its speculative display of results helped them
  discover patterns in the data more quickly. In the study, SpeQL improves user's
  query latency by up to 289times and kept the overhead reasonable, at 4$
  per hour.
paper_authors._id: 67c6a803025b72f14ccb0939
paper_authors.name: Haoyu Li
paper_authors.status: extracted_pending
paper_authors.statusLastChangedAt: 2025-03-04T07:13:08.306Z
paper_authors._id: 6577437552f02732a463d97d
paper_authors.avatarUrl: /avatars/8eb271ec249fa9b0d97dfe0eace6da88.svg
paper_authors.fullname: Haoyu Li
paper_authors.type: user
paper_authors.user: Haoyu0529
paper_authors._id: 67c6a803025b72f14ccb093a
paper_authors.name: Srikanth Kandula
paper_authors._id: 67c6a803025b72f14ccb093b
paper_authors.name: Maria Angels de Luis Balaguer
paper_authors._id: 67c6a803025b72f14ccb093c
paper_authors.name: Aditya Akella
paper_authors._id: 67c6a803025b72f14ccb093d
paper_authors.name: Venkat Arun
paper_title: Speculative Ad-hoc Querying
paper_summary: Analyzing large datasets requires responsive query execution, but executing
  SQL queries on massive datasets can be slow. This paper explores whether query
  execution can begin even before the user has finished typing, allowing results
  to appear almost instantly. We propose SpeQL, a system that leverages Large
  Language Models (LLMs) to predict likely queries based on the database schema,
  the user's past queries, and their incomplete query. Since exact query
  prediction is infeasible, SpeQL speculates on partial queries in two ways: 1)
  it predicts the query structure to compile and plan queries in advance, and 2)
  it precomputes smaller temporary tables that are much smaller than the original
  database, but are still predicted to contain all information necessary to
  answer the user's final query. Additionally, SpeQL continuously displays
  results for speculated queries and subqueries in real time, aiding exploratory
  analysis. A utility/user study showed that SpeQL improved task completion time,
  and participants reported that its speculative display of results helped them
  discover patterns in the data more quickly. In the study, SpeQL improves user's
  query latency by up to 289times and kept the overhead reasonable, at 4$
  per hour.
paper_ai_summary: SpeQL, a system leveraging Large Language Models, predicts and executes SQL queries in advance to significantly reduce latency and improve exploratory data analysis efficiency.
paper_ai_keywords: Large Language Models query prediction query structure speculative query execution temporary tables exploratory data analysis