Cloudflare D1 / Query Workbench
The right answer.
At what cost?
Same results can take very different work.
Compare row reads. Check correctness. Catch the regression.
01 / Query Lab
1,000 orders 10 merchants
Two identical tables.
One composite index.
A 100-row
read budget.
Candidate No index
Run the experiment to check the answer and the work behind it.
Measured results will appear here.
</> Inspect the EvidenceSQL / query plans / returned orders
Baseline Query
Query Plan
Candidate Query
Query Plan
Bound parameter: merchant_id = 1.
Plans explain the measurement; their text does not determine
pass/fail.
Returned Orders Full, ordered result arrays
Raw Report Metadata & provenance
PrototypeThree fixed scenarios. A CLI that verifies saved reports. Not an automatic benchmark for arbitrary pull requests.
Correct is necessary.
Efficient deserves a test.
A small experiment with a strict rule:
a cheaper wrong answer
never passes.
Hold the Data Constant
Two copies of 1,000 synthetic orders. Same merchant, same sorting, same expected results. One table has a lookup index.
Measure the Database Work
D1 reports how many rows it reads to find the answer. That can be far more than the number of orders it returns.
Check Both Sides of the Tradeoff
Compare every returned field and its order. Then check reads against the 100-row budget. Both checks must pass.