improved primary-key where clause in the face of unbound slots