Failing to identify that a correlated subquery cannot be planned when the parent query FROM clause has a reference table: SELECT (SELECT max(u1.time) FROM users_table u1 JOIN users_reference_table u2 ...