Two SQL queries can look equivalent and return different answers. Query Witness finds a small, valid DuckDB database that shows the difference and saves it for replay.
Preparing an example…
A concrete example
An unassigned support ticket still exists. COUNT(*) counts it; COUNT(assignee_id) skips it because the assignee is NULL. That single row shows why the queries aren’t equivalent.
My contribution
I directed AI implementation agents and worked through examples to question the results. Separate reviews caught correctness problems we then fixed, including a timeout in the final comparison that could be reported as a completed result.
Kept deliberately small
The tool supports one table with up to two integer columns and a restricted SQL subset. It finds differences you can inspect. If the search runs out of time or attempts, that doesn’t prove the queries equivalent.