CORE-6161 converted count-uuids ctor to func.
CORE-6161 optimized uuid count query