Computing / Databases
Database query planning and SQL generation
Explore query rewrites or candidate generators while preserving answers.

01 / The commercial question
How can SQL optimization preserve correctness across workloads?
An equivalent rewrite may help one data distribution and hurt another. Freeze database snapshots and compare warm and cold execution where relevant. Bound query runtime and memory so failed candidates cannot disrupt the evaluation host.
02 / Experiment design
How Discovery would approach database query planning and sql generation.
- 01 / Starting program
What does the first databases experiment start from?
- An existing query generator or database execution plan.
- 02 / Objective & constraints
What counts as a better answer?
- Answer correctness, execution latency and resource usage on a held-out workload.
- 03 / Data & evaluation
How is each candidate tested?
- Database snapshots, queries, expected answers and isolated execution limits.
- 04 / Validation path
What has to hold before it reaches operations?
- Report wrong-answer rates separately; do not equate query benchmark scores with production savings.
- 01 / Source systemIsolated database snapshot
- 02 / Input dataQueries + expected result sets
- 03 / Candidate programRewrite / generation program
- 04 / EvaluatorQuery execution sandbox
- 05 / Recorded outputAnswer checks + latency profile
03 / First experiment
Make the comparison reproducible.
Freeze the seed program and the grader. Compare candidates under equal evaluation budgets, keep every failed run, and reserve unseen scenarios for the final test.
What you receive: the accepted program, its score against today's rule on held-out scenarios, and the record of directions tried. The full method.
04 / Related
Related operating decisions.
Computing / Kernel engineeringKernel instruction scheduling and memory accessSearch for equivalent program implementations with lower execution cost.Algorithms · Code
Computing / Cloud schedulingCloud workload placement and autoscalingPlace jobs and adjust capacity around variable demand.Scheduling · Queues
Computing / NetworksNetwork traffic engineering and queue managementTune path selection and queue policies for changing traffic patterns.Routing · Queues