~/talk

Performant SQL Rewrites using LLMs

Talkat PGConf India 2026 · 2026-03-11..03-13· [large-language-models, databases]
links:none on file
slides:none on file

System called LITHE rewrites SQL for PostgreSQL using an ensemble of prompts, database-aware rules like selectivity-guided rewriting, and token-probability driven search (token-probability MCTS), then runs syntax and semantic checks before DBA review. On TPC-DS (99 queries) LITHE finds 26 productive rewrites (>=50% faster), reports a geometric-mean optimizer-cost speedup ≈11.8 and measured time speedup ≈13.2; one rewrite yields ~6,500× improvement. Uses GPT-class LLMs for generation and combined statistical and provable verification to catch semantic errors.

AI-written summary · about

  1. 0:00Introduction and welcome
  2. 1:31LLMs for SQL performance
  3. 8:53Postgres query processor overview
  4. 12:46SQL rewriting challenges
  5. 20:14LLM-based query rewrite system
  6. 25:30Prompting strategies for LLMs
  7. 27:55Benchmarking with TPC-DS
  8. 31:27Database knowledge in prompts
  9. 34:14Selectivity-guided rewrites
  10. 37:00Handling LLM uncertainty
  11. 39:30Monte Carlo tree search demo
  12. 41:41Verifying semantic equivalence
  13. 43:04Statistical vs provable verification
  14. 45:51Sample database techniques
  15. 47:18Plan-based equivalence checks
  16. 49:02Mutation-based testing
  17. 50:29TPC-DS benchmark results
  18. 52:36Conclusion and future work
~/search
type to search 8,222 conferences, 162,397 speakers and 219,688 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
← →
on a talk: 5 seconds back / forward
0–9
on a talk: jump to 0%–90% of the recording
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.