Handle query grouping in graphite backend.