### 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/operator/MultivalueDedupe.java
/**
     * Remove duplicate values from each position and write the results to a
     * {@link Block} using an adaptive algorithm based on the size of the input list.
     */
    public static Block.Ref dedupeToBlockAdaptive(Block.Ref ref) {
        return switch (ref.block().elementType()) {
            case BOOLEAN -> new MultivalueDedupeBoolean(ref).dedupeToBlock();
            case BYTES_REF -> new MultivalueDedupeBytesRef(ref).dedupeToBlockAdaptive();
            case INT -> new MultivalueDedupeInt(ref).dedupeToBlockAdaptive();
            case LONG -> new MultivalueDedupeLong(ref).dedupeToBlockAdaptive();
            case DOUBLE -> new MultivalueDedupeDouble(ref).dedupeToBlockAdaptive();
            default -> throw new IllegalArgumentException();
        };
    }
    /**
     * Remove duplicate values from each position and write the results to a
     * {@link Block} using an algorithm with very low overhead but {@code n^2}
     * case complexity for larger. Prefer {@link #dedupeToBlockAdaptive}
     * which picks based on the number of elements at each position.
     */
    public static Block.Ref dedupeToBlockUsingCopyMissing(Block.Ref ref) {
        return switch (ref.block().elementType()) {
            case BOOLEAN -> new MultivalueDedupeBoolean(ref).dedupeToBlock();
            case BYTES_REF -> new MultivalueDedupeBytesRef(ref).dedupeToBlockUsingCopyMissing();
            case INT -> new MultivalueDedupeInt(ref).dedupeToBlockUsingCopyMissing();