Fixing three way sort merge join