prevent buildAnyQuery matching db id of study, should resolve #2683