optimized query for label counters
Merge pull request #299 from rangerer/label_counters

optimized query for label counters