improved count join for the equals case.