fix issue with in-memory join when custom primary keys are used