you should probably use ug.usergroup_member_ids instead as it would just join the usergroup_members table vs the usergroups as well