LPS-46779 Improved query: get the mapped objects from the first query instead of getting userIds first and then iterate to get mapped objects