### Description

![image](https://github.com/elastic/elasticsearch/assets/76245/d0443170-0419-4759-b505-7620ff3d6594)

The execution time of grouping stats by multiple keywords has increased: 1.2 to 1.6 seconds (with doc_partitioning), 4.3 to 6.7 seconds (with shard_partitioning). The equivalent query with the _search API takes 1.8 seconds.

`from nyc_taxis | ... | stats c = count(dropoff_datetime) by trip_type, payment_type, vendor_id`

This regression occurred since July 2, 2023, and I suspect it may be due to the PR: [Support multivalued fields on arbitrary grouping](https://github.com/elastic/elasticsearch-internal/pull/1340).

/cc @nik9000
x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/aggregation/blockhash/PackedValuesBlockHash.java
outer: for (;;) {
                for (; g < groups.length; g++) {
                    Group group = groups[g];
                    group.bytesStart = bytes.length();
                    BytesRef v = group.encoder.read(group.valueOffset + group.loopedIndex, scratch);
                    ++group.loopedIndex;
                    if (v.length == 0) {
                        assert group.valueCount == 1 : "null value in non-singleton list";
                        int nullByte = g / 8;
                        int nullShift = g % 8;
                        bytes.bytes()[nullByte] |= (byte) (1 << nullShift);
                    } else {
                        bytes.append(v);
                    }
                }
                
                int ord = Math.toIntExact(hashOrdToGroup(bytesRefHash.add(bytes.get())));
                ords.appendInt(ord);
                addedValueInMultivaluePosition(position);
                
                Group group = groups[--g];
                bytes.setLength(group.bytesStart);
                while (group.loopedIndex == group.valueCount) {
                    group.loopedIndex = 0;
                    if (g == 0) {
                        break outer;
                    } else {
                        group = groups[--g];
                        bytes.setLength(group.bytesStart);
                    }