Restricted usage of the counting query class for the rdb repository to
calls made through an aggregate.