### 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
final int positionCount;
        int position;
        AddWork(Page page, GroupingAggregatorFunction.AddInput addInput, int batchSize) {
            super(emitBatchSize, addInput);
            for (Group group : groups) {
                group.encoder = MultivalueDedupe.batchEncoder(new Block.Ref(page.getBlock(group.spec.channel()), page), batchSize);
            }
            bytes.grow(nullTrackingBytes);
            this.positionCount = page.getPositionCount();
        }
        /**
         * Encodes one permutation of the keys at time into {@link #bytes}. The encoding is
         * mostly provided by {@link BatchEncoder} with nulls living in a bit mask at the
         * front of the bytes.
         */
        void add() {
            for (position = 0; position < positionCount; position++) {
                
                boolean singleEntry = true;
                for (Group g : groups) {
                    var encoder = g.encoder;
                    g.positionOffset++;
                    while (g.positionOffset >= encoder.positionCount()) {
                        encoder.encodeNextBatch();
                        g.positionOffset = 0;
                        g.valueOffset = 0;
                    }
                    g.valueCount = encoder.valueCount(g.positionOffset);
                    singleEntry &= (g.valueCount == 1);