Lessons from Bug Hunters Who've Found 400 Bugs in Popular DBMSs
pingcap.com
pingcap.com
Building tons of queries with some randomized approach and using a query mapping strategy to re-write them in a way that can't be optimized. Run both queries and see if they differ.