How jimmyu2foru18/project-1-unnesting-queries works
This repository demonstrates SQL-query unnesting with LLMs and compares nested versus unnested query runtimes. The main workflow builds a prompt, calls a selected LLM provider, and extracts SQL; separate scripts benchmark sample TPC-H data or an IMDb database. Prompt templates and cross-database SQL snippets are additional capabilities. The graph follows the sampled entry points and documented behavior; the IMDb setup SQL is not present in the tree.
Main entry points: imdb_unnesting_script.py IMDb Benchmark · main.py LLM Demo · times.py Sample Benchmark · llm.py LLM Client
Components 13
Unnesting
- LLM Demo
main.py - Demo Prompt
main.py - LLM Client
llm.py
Query Benchmarking
- Sample Benchmark
times.py - Sample Data Setup
times.py - Query Timer
times.py - IMDb Benchmark
imdb_unnesting_script.py - Nested Query Input
Nested_Queries.sql
Prompt and SQL Support
- Prompt Templates
prompt.py - SQL Dialect Helper
database_consistency.py
External Services
- DuckDB
- LLM Providers
Other components
- User
Connections 16
- User → LLM Demo: runs
README.md - LLM Demo → Demo Prompt: builds prompt
main.py - LLM Demo → LLM Client: calls
main.py - LLM Client → LLM Providers: sends requests
llm.py - LLM Demo → SQL Dialect Helper: gets SQL snippet
main.py - User → Sample Benchmark: runs
README.md - Sample Benchmark → LLM Client: requests rewrite
times.py - Sample Benchmark → Sample Data Setup: sets up
times.py - Sample Benchmark → Query Timer: times queries
times.py - Sample Data Setup → DuckDB: creates tables
times.py - Query Timer → DuckDB: executes queries
times.py - User → IMDb Benchmark: runs
README.md - IMDb Benchmark → Nested Query Input: reads query
imdb_unnesting_script.py - IMDb Benchmark → LLM Client: requests rewrite
imdb_unnesting_script.py - IMDb Benchmark → DuckDB: executes SQL
imdb_unnesting_script.py - IMDb Benchmark → SQL Dialect Helper: imports helper
imdb_unnesting_script.py