A novel, low-latency algorithm for multiple group-by query optimization