Revert some of the changes
Add optimize() for join queries
Add HashJoinTestWithIndex