Fixed #12886 -- aggregation over sliced queryset