๐Ÿ—„๏ธ

SQL Query Optimizer

OpenEnv Hackathon 2026 โ€” Meta PyTorch ร— Scaler
โšก DuckDB Live Execution

Paste your SQL below. We execute both the original and your rewrite against a real 1.5M-row DuckDB database and return actual timing. No simulations. No keyword matching. The database is the judge.

โš™๏ธ Configure Query
๐Ÿ“‹ Task Details & Expected Results

Select a task on the left, then click Load Verified Sample Solution to auto-fill a tested SQL rewrite.

Schema quick ref:
users: id, email, tier, region, plan, created_at
orders: id, customer_id, product_id, status, total, created_at
events: id, user_id, session_id, event_type, occurred_at

โš ๏ธ Common gotchas:
โ€ข events uses occurred_at (not created_at)
โ€ข users uses tier (not status)
โ€ข Task 3: original WHERE returns all 1M rows (sess_ matches all)

๐Ÿ“Š Execution Results

โ€”
Speedup
โ€”
Original (ms)
โ€”
Optimized (ms)
โ€”
Results Match
โ€”
Original Rows
โ€”
Optimized Rows
โณ Running...