Efficient way to get all users who do/do not have an avatar?

I am looking for an efficient way (direct DB queries are fine) to efficiently get all users who do or do not have an avatar uploaded.

A couple of considerations:

  1. cs_UserProfile.IsAvatarApproved column on gets set to "1" and stays at "1" even when the user removes their avatar.
  2. Doing a like '%avatarUrl%' on the cs_UserProfile.PropertyNames is not efficient at all - but could work
  3. I would rather not request each user individually
  4. cs_UserProfile.EnableAvatar always seems to be set to "0" with our current site settings

  • This needs to be done in code using REST or in process API, not SQL.  

    There is no efficient or easy way to get an avatar url via the DB anyway, its still stored in variable position mapped string