LPS-51018 Use distinct in both count and find by