Updated to delegate to the compiler. Also made mysql use row constructor format instead of dependent subquery