Skip to content

Conversation

@EmilyMatt
Copy link
Contributor

@EmilyMatt EmilyMatt commented Dec 25, 2025

Which issue does this PR close?

Closes #19493 .

Rationale for this change

Greatly reduces the memory requested by ExternalSorter to perform sorts, adds much more granularity to the reservations, and Tries to do this with minimal overhead by merging the splitting and sorting processes.

What changes are included in this PR?

The sort stream will calculate the indices once, but the take will be done in batches, so we create batch_size sized RecordBatches, whose get_record_batch_size results return info that is very close to their sliced sizes(if not completely the same), this means there is no need for the precaution of reserving a huge amount of memory in order to do the merge sort, meaning we can merge more streams at the same time, and so on and so forth.

Are these changes tested?

Yes

Are there any user-facing changes?

There is a new sort_batch_chunked function, which returns a Vec of RecordBatch, based on the provided batch_size.
Some docs are updated.

@github-actions github-actions bot added the physical-plan Changes to the physical-plan crate label Dec 25, 2025
let indices = lexsort_to_indices(&sort_columns, fetch)?;
let mut columns = take_arrays(batch.columns(), &indices, None)?;

// The columns may be larger than the unsorted columns in `batch` especially for variable length
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not really needed as take actually uses the offsets for variable length columns.
At worst the buffers themselves will be rounded up to the 64 byte multiplier to optimize SIMD operations, but that is actually desirable and not something we want to mess with.

@rluvaton
Copy link
Member

run benchmarks

@alamb-ghbot
Copy link

🤖 ./gh_compare_branch.sh gh_compare_branch.sh Running
Linux aal-dev 6.14.0-1018-gcp #19~24.04.1-Ubuntu SMP Wed Sep 24 23:23:09 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Comparing improve-sort-by-chunking (5420c3b) to e586ff5 diff using: tpch_mem clickbench_partitioned clickbench_extended
Results will be posted here when complete

@rluvaton
Copy link
Member

run benchmark sort

@alamb-ghbot
Copy link

🤖 Hi @rluvaton, thanks for the request (#19494 (comment)).

scrape_comments.py only supports whitelisted benchmarks.

  • Standard: clickbench_1, clickbench_extended, clickbench_partitioned, clickbench_pushdown, external_aggr, tpcds, tpch, tpch10, tpch_mem, tpch_mem10
  • Criterion: aggregate_query_sql, aggregate_vectorized, case_when, in_list, range_and_generate_series, sql_planner, with_hashes

Please choose one or more of these with run benchmark <name> or run benchmark <name1> <name2>...
Unsupported benchmarks: sort.

@alamb-ghbot
Copy link

🤖: Benchmark completed

Details

Comparing HEAD and improve-sort-by-chunking
--------------------
Benchmark clickbench_extended.json
--------------------
┏━━━━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Query        ┃        HEAD ┃ improve-sort-by-chunking ┃        Change ┃
┡━━━━━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ QQuery 0     │  2549.12 ms │               2514.24 ms │     no change │
│ QQuery 1     │  1059.93 ms │               1040.90 ms │     no change │
│ QQuery 2     │  2046.76 ms │               2069.09 ms │     no change │
│ QQuery 3     │  1208.63 ms │               1120.50 ms │ +1.08x faster │
│ QQuery 4     │  2267.24 ms │               2300.34 ms │     no change │
│ QQuery 5     │ 28456.26 ms │              28452.98 ms │     no change │
│ QQuery 6     │  3900.55 ms │               3838.68 ms │     no change │
│ QQuery 7     │  3713.11 ms │               3590.57 ms │     no change │
└──────────────┴─────────────┴──────────────────────────┴───────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
┃ Benchmark Summary                       ┃            ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━┩
│ Total Time (HEAD)                       │ 45201.60ms │
│ Total Time (improve-sort-by-chunking)   │ 44927.31ms │
│ Average Time (HEAD)                     │  5650.20ms │
│ Average Time (improve-sort-by-chunking) │  5615.91ms │
│ Queries Faster                          │          1 │
│ Queries Slower                          │          0 │
│ Queries with No Change                  │          7 │
│ Queries with Failure                    │          0 │
└─────────────────────────────────────────┴────────────┘
--------------------
Benchmark clickbench_partitioned.json
--------------------
┏━━━━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Query        ┃        HEAD ┃ improve-sort-by-chunking ┃        Change ┃
┡━━━━━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ QQuery 0     │     2.13 ms │                  2.24 ms │  1.05x slower │
│ QQuery 1     │    50.17 ms │                 49.80 ms │     no change │
│ QQuery 2     │   134.03 ms │                136.18 ms │     no change │
│ QQuery 3     │   157.43 ms │                150.26 ms │     no change │
│ QQuery 4     │  1057.23 ms │               1094.75 ms │     no change │
│ QQuery 5     │  1470.78 ms │               1471.05 ms │     no change │
│ QQuery 6     │     2.14 ms │                  2.08 ms │     no change │
│ QQuery 7     │    54.75 ms │                 53.64 ms │     no change │
│ QQuery 8     │  1421.84 ms │               1428.04 ms │     no change │
│ QQuery 9     │  1902.45 ms │               1870.69 ms │     no change │
│ QQuery 10    │   348.38 ms │                352.11 ms │     no change │
│ QQuery 11    │   400.92 ms │                414.60 ms │     no change │
│ QQuery 12    │  1372.85 ms │               1396.67 ms │     no change │
│ QQuery 13    │  2000.33 ms │               2035.71 ms │     no change │
│ QQuery 14    │  1255.81 ms │               1259.34 ms │     no change │
│ QQuery 15    │  1262.68 ms │               1277.13 ms │     no change │
│ QQuery 16    │  2592.61 ms │               2557.18 ms │     no change │
│ QQuery 17    │  2527.36 ms │               2518.02 ms │     no change │
│ QQuery 18    │  5392.63 ms │               4903.92 ms │ +1.10x faster │
│ QQuery 19    │   122.06 ms │                120.44 ms │     no change │
│ QQuery 20    │  1975.94 ms │               1862.58 ms │ +1.06x faster │
│ QQuery 21    │  2291.54 ms │               2174.01 ms │ +1.05x faster │
│ QQuery 22    │  3815.16 ms │               3753.00 ms │     no change │
│ QQuery 23    │ 18099.94 ms │              12178.23 ms │ +1.49x faster │
│ QQuery 24    │   214.48 ms │                210.25 ms │     no change │
│ QQuery 25    │   470.77 ms │                469.99 ms │     no change │
│ QQuery 26    │   220.11 ms │                221.24 ms │     no change │
│ QQuery 27    │  2784.06 ms │               2697.51 ms │     no change │
│ QQuery 28    │ 22372.28 ms │              23500.57 ms │  1.05x slower │
│ QQuery 29    │   960.40 ms │                984.08 ms │     no change │
│ QQuery 30    │  1339.25 ms │               1312.56 ms │     no change │
│ QQuery 31    │  1352.89 ms │               1321.14 ms │     no change │
│ QQuery 32    │  5183.50 ms │               4681.80 ms │ +1.11x faster │
│ QQuery 33    │  6023.97 ms │               5772.23 ms │     no change │
│ QQuery 34    │  6009.83 ms │               5849.35 ms │     no change │
│ QQuery 35    │  1916.19 ms │               1877.65 ms │     no change │
│ QQuery 36    │    66.84 ms │                 67.11 ms │     no change │
│ QQuery 37    │    45.61 ms │                 46.70 ms │     no change │
│ QQuery 38    │    67.30 ms │                 65.49 ms │     no change │
│ QQuery 39    │   105.68 ms │                101.78 ms │     no change │
│ QQuery 40    │    26.59 ms │                 27.11 ms │     no change │
│ QQuery 41    │    22.67 ms │                 22.84 ms │     no change │
│ QQuery 42    │    19.56 ms │                 18.70 ms │     no change │
└──────────────┴─────────────┴──────────────────────────┴───────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
┃ Benchmark Summary                       ┃            ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━┩
│ Total Time (HEAD)                       │ 98913.13ms │
│ Total Time (improve-sort-by-chunking)   │ 92309.74ms │
│ Average Time (HEAD)                     │  2300.31ms │
│ Average Time (improve-sort-by-chunking) │  2146.74ms │
│ Queries Faster                          │          5 │
│ Queries Slower                          │          2 │
│ Queries with No Change                  │         36 │
│ Queries with Failure                    │          0 │
└─────────────────────────────────────────┴────────────┘
--------------------
Benchmark tpch_mem_sf1.json
--------------------
┏━━━━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Query        ┃      HEAD ┃ improve-sort-by-chunking ┃        Change ┃
┡━━━━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ QQuery 1     │ 116.24 ms │                117.50 ms │     no change │
│ QQuery 2     │  28.76 ms │                 28.72 ms │     no change │
│ QQuery 3     │  37.49 ms │                 34.63 ms │ +1.08x faster │
│ QQuery 4     │  28.99 ms │                 28.96 ms │     no change │
│ QQuery 5     │  86.35 ms │                 88.24 ms │     no change │
│ QQuery 6     │  19.74 ms │                 19.50 ms │     no change │
│ QQuery 7     │ 230.09 ms │                233.94 ms │     no change │
│ QQuery 8     │  35.88 ms │                 37.35 ms │     no change │
│ QQuery 9     │ 104.29 ms │                101.83 ms │     no change │
│ QQuery 10    │  62.58 ms │                 63.36 ms │     no change │
│ QQuery 11    │  18.14 ms │                 17.98 ms │     no change │
│ QQuery 12    │  51.32 ms │                 51.03 ms │     no change │
│ QQuery 13    │  48.50 ms │                 47.04 ms │     no change │
│ QQuery 14    │  14.74 ms │                 13.66 ms │ +1.08x faster │
│ QQuery 15    │  24.79 ms │                 24.24 ms │     no change │
│ QQuery 16    │  24.48 ms │                 24.24 ms │     no change │
│ QQuery 17    │ 153.76 ms │                153.85 ms │     no change │
│ QQuery 18    │ 281.20 ms │                280.04 ms │     no change │
│ QQuery 19    │  38.52 ms │                 39.03 ms │     no change │
│ QQuery 20    │  48.79 ms │                 47.96 ms │     no change │
│ QQuery 21    │ 289.15 ms │                311.06 ms │  1.08x slower │
│ QQuery 22    │  17.38 ms │                 17.28 ms │     no change │
└──────────────┴───────────┴──────────────────────────┴───────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━┓
┃ Benchmark Summary                       ┃           ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━┩
│ Total Time (HEAD)                       │ 1761.18ms │
│ Total Time (improve-sort-by-chunking)   │ 1781.42ms │
│ Average Time (HEAD)                     │   80.05ms │
│ Average Time (improve-sort-by-chunking) │   80.97ms │
│ Queries Faster                          │         2 │
│ Queries Slower                          │         1 │
│ Queries with No Change                  │        19 │
│ Queries with Failure                    │         0 │
└─────────────────────────────────────────┴───────────┘

@alamb
Copy link
Contributor

alamb commented Dec 27, 2025

run benchmark clickbench_partitioned

@alamb-ghbot
Copy link

🤖 ./gh_compare_branch.sh gh_compare_branch.sh Running
Linux aal-dev 6.14.0-1018-gcp #19~24.04.1-Ubuntu SMP Wed Sep 24 23:23:09 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Comparing improve-sort-by-chunking (5420c3b) to e586ff5 diff using: clickbench_partitioned
Results will be posted here when complete

@alamb-ghbot
Copy link

🤖: Benchmark completed

Details

Comparing HEAD and improve-sort-by-chunking
--------------------
Benchmark clickbench_partitioned.json
--------------------
┏━━━━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Query        ┃        HEAD ┃ improve-sort-by-chunking ┃        Change ┃
┡━━━━━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ QQuery 0     │     2.07 ms │                  2.10 ms │     no change │
│ QQuery 1     │    50.47 ms │                 50.51 ms │     no change │
│ QQuery 2     │   138.23 ms │                135.67 ms │     no change │
│ QQuery 3     │   152.24 ms │                154.44 ms │     no change │
│ QQuery 4     │  1130.98 ms │               1076.71 ms │     no change │
│ QQuery 5     │  1447.71 ms │               1454.81 ms │     no change │
│ QQuery 6     │     2.04 ms │                  2.10 ms │     no change │
│ QQuery 7     │    53.85 ms │                 52.87 ms │     no change │
│ QQuery 8     │  1441.13 ms │               1388.88 ms │     no change │
│ QQuery 9     │  1862.33 ms │               1896.93 ms │     no change │
│ QQuery 10    │   337.87 ms │                346.28 ms │     no change │
│ QQuery 11    │   397.94 ms │                395.73 ms │     no change │
│ QQuery 12    │  1371.76 ms │               1351.79 ms │     no change │
│ QQuery 13    │  2010.14 ms │               2014.51 ms │     no change │
│ QQuery 14    │  1259.92 ms │               1215.38 ms │     no change │
│ QQuery 15    │  1253.51 ms │               1203.90 ms │     no change │
│ QQuery 16    │  2463.13 ms │               2510.31 ms │     no change │
│ QQuery 17    │  2446.32 ms │               2444.88 ms │     no change │
│ QQuery 18    │  5183.17 ms │               4743.19 ms │ +1.09x faster │
│ QQuery 19    │   121.25 ms │                122.38 ms │     no change │
│ QQuery 20    │  1940.33 ms │               1838.83 ms │ +1.06x faster │
│ QQuery 21    │  2243.25 ms │               2159.93 ms │     no change │
│ QQuery 22    │  3818.54 ms │               3693.12 ms │     no change │
│ QQuery 23    │ 16413.40 ms │              12112.07 ms │ +1.36x faster │
│ QQuery 24    │   212.69 ms │                204.49 ms │     no change │
│ QQuery 25    │   471.40 ms │                454.41 ms │     no change │
│ QQuery 26    │   214.54 ms │                213.09 ms │     no change │
│ QQuery 27    │  2720.20 ms │               2686.02 ms │     no change │
│ QQuery 28    │ 22086.76 ms │              23491.24 ms │  1.06x slower │
│ QQuery 29    │   952.40 ms │                978.57 ms │     no change │
│ QQuery 30    │  1351.17 ms │               1279.85 ms │ +1.06x faster │
│ QQuery 31    │  1394.42 ms │               1321.94 ms │ +1.05x faster │
│ QQuery 32    │  5599.44 ms │               4841.53 ms │ +1.16x faster │
│ QQuery 33    │  5813.23 ms │               5612.59 ms │     no change │
│ QQuery 34    │  6039.97 ms │               5901.26 ms │     no change │
│ QQuery 35    │  1880.06 ms │               1857.74 ms │     no change │
│ QQuery 36    │    69.60 ms │                 68.21 ms │     no change │
│ QQuery 37    │    44.22 ms │                 43.93 ms │     no change │
│ QQuery 38    │    69.01 ms │                 65.44 ms │ +1.05x faster │
│ QQuery 39    │   102.44 ms │                102.33 ms │     no change │
│ QQuery 40    │    26.50 ms │                 26.14 ms │     no change │
│ QQuery 41    │    23.75 ms │                 22.81 ms │     no change │
│ QQuery 42    │    19.27 ms │                 20.06 ms │     no change │
└──────────────┴─────────────┴──────────────────────────┴───────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
┃ Benchmark Summary                       ┃            ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━┩
│ Total Time (HEAD)                       │ 96632.68ms │
│ Total Time (improve-sort-by-chunking)   │ 91558.94ms │
│ Average Time (HEAD)                     │  2247.27ms │
│ Average Time (improve-sort-by-chunking) │  2129.28ms │
│ Queries Faster                          │          7 │
│ Queries Slower                          │          1 │
│ Queries with No Change                  │         35 │
│ Queries with Failure                    │          0 │
└─────────────────────────────────────────┴────────────┘

@rluvaton
Copy link
Member

run benchmark sort

@alamb-ghbot
Copy link

🤖 ./gh_compare_branch_bench.sh compare_branch_bench.sh Running
Linux aal-dev 6.14.0-1018-gcp #19~24.04.1-Ubuntu SMP Wed Sep 24 23:23:09 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Comparing improve-sort-by-chunking (5420c3b) to e586ff5 diff
BENCH_NAME=sort
BENCH_COMMAND=cargo bench --features=parquet --bench sort
BENCH_FILTER=
BENCH_BRANCH_NAME=improve-sort-by-chunking
Results will be posted here when complete

// Spilling to disk and reading back also ensures batch size is consistent
// rather than potentially having one significantly larger last batch.
self.spill()?;
self.spill()?; // TODO: use sort_batch_chunked instead
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will you address this in this pr?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so, I initially thought about this but then I saw there's an immediate spill now, rather than returning an in memory stream, which feels like a deliberate decision, and I didn't want to add side-effects to this PR

Comment on lines 832 to 836
/// This is calculated by adding the record batch's memory size
/// (which can be much larger than expected for sliced record batches)
/// with the sliced buffer sizes, as that is the amount that will be needed to create the new buffer.
/// The latter is rounded up to the nearest multiple of 64 based on the architecture,
/// as this is how arrow creates buffers.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/// Estimate how much memory is needed to sort a `RecordBatch`.
/// 
/// For sliced batches, `get_record_batch_memory_size` returns the size of the 
/// underlying shared buffers (which may be larger than the logical data).
/// We add `get_sliced_size()` (the actual logical data size, rounded to 64 bytes)
/// because sorting will create new buffers containing only the referenced data.
/// 
/// Total = existing buffer size + new sorted buffer size

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fine by me, updated.

Copy link
Member

@Weijun-H Weijun-H left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very impressive pr 👍 I left some suggestion for your reference

@alamb-ghbot
Copy link

🤖: Benchmark completed

Details

group                                          improve-sort-by-chunking                main
-----                                          ------------------------                ----
merge sorted f64                               1.00      5.2±0.17ms        ? ?/sec     1.00      5.3±0.14ms        ? ?/sec
merge sorted i64                               1.00      5.1±0.17ms        ? ?/sec     1.00      5.1±0.14ms        ? ?/sec
merge sorted mixed dictionary tuple            1.00     13.2±0.34ms        ? ?/sec     1.00     13.2±0.29ms        ? ?/sec
merge sorted mixed tuple                       1.00     12.0±0.24ms        ? ?/sec     1.00     12.0±0.26ms        ? ?/sec
merge sorted mixed tuple with utf8 view        1.00     11.3±0.30ms        ? ?/sec     1.00     11.3±0.24ms        ? ?/sec
merge sorted utf8 dictionary                   1.01      5.2±0.24ms        ? ?/sec     1.00      5.1±0.24ms        ? ?/sec
merge sorted utf8 dictionary tuple             1.02      7.6±0.30ms        ? ?/sec     1.00      7.5±0.24ms        ? ?/sec
merge sorted utf8 high cardinality             1.00      7.5±0.14ms        ? ?/sec     1.02      7.6±0.24ms        ? ?/sec
merge sorted utf8 low cardinality              1.00      5.0±0.21ms        ? ?/sec     1.00      5.0±0.20ms        ? ?/sec
merge sorted utf8 tuple                        1.00     12.5±0.25ms        ? ?/sec     1.01     12.6±0.73ms        ? ?/sec
merge sorted utf8 view high cardinality        1.00      6.4±0.14ms        ? ?/sec     1.02      6.5±0.24ms        ? ?/sec
merge sorted utf8 view low cardinality         1.00      4.0±0.24ms        ? ?/sec     1.01      4.1±0.18ms        ? ?/sec
merge sorted utf8 view tuple                   1.00     11.7±0.28ms        ? ?/sec     1.00     11.7±0.30ms        ? ?/sec
sort f64                                       1.00      7.8±0.13ms        ? ?/sec     1.00      7.8±0.05ms        ? ?/sec
sort i64                                       1.00      7.6±0.06ms        ? ?/sec     1.02      7.8±0.45ms        ? ?/sec
sort merge f64                                 1.00      5.2±0.19ms        ? ?/sec     1.00      5.2±0.15ms        ? ?/sec
sort merge i64                                 1.00      5.0±0.04ms        ? ?/sec     1.00      5.0±0.13ms        ? ?/sec
sort merge mixed dictionary tuple              1.00     13.3±0.39ms        ? ?/sec     1.00     13.3±0.49ms        ? ?/sec
sort merge mixed tuple                         1.00     12.2±0.11ms        ? ?/sec     1.00     12.2±0.21ms        ? ?/sec
sort merge mixed tuple with utf8 view          1.00     13.4±0.24ms        ? ?/sec     1.00     13.4±0.37ms        ? ?/sec
sort merge utf8 dictionary                     1.02      5.0±0.08ms        ? ?/sec     1.00      4.9±0.07ms        ? ?/sec
sort merge utf8 dictionary tuple               1.02      7.6±0.06ms        ? ?/sec     1.00      7.5±0.07ms        ? ?/sec
sort merge utf8 high cardinality               1.00      7.6±0.11ms        ? ?/sec     1.00      7.5±0.16ms        ? ?/sec
sort merge utf8 low cardinality                1.01      5.0±0.14ms        ? ?/sec     1.00      5.0±0.11ms        ? ?/sec
sort merge utf8 tuple                          1.00     16.0±0.46ms        ? ?/sec     1.00     16.0±0.14ms        ? ?/sec
sort merge utf8 view high cardinality          1.00      7.7±0.15ms        ? ?/sec     1.00      7.7±0.21ms        ? ?/sec
sort merge utf8 view low cardinality           1.02      4.1±0.36ms        ? ?/sec     1.00      4.0±0.10ms        ? ?/sec
sort merge utf8 view tuple                     1.00     14.9±0.24ms        ? ?/sec     1.00     14.9±0.29ms        ? ?/sec
sort mixed dictionary tuple                    1.03     20.5±0.18ms        ? ?/sec     1.00     19.8±0.25ms        ? ?/sec
sort mixed tuple                               1.01     15.9±0.38ms        ? ?/sec     1.00     15.7±0.44ms        ? ?/sec
sort mixed tuple with utf8 view                1.02     15.0±0.27ms        ? ?/sec     1.00     14.8±0.21ms        ? ?/sec
sort partitioned f64                           1.00  250.5±255.41µs        ? ?/sec     1.02  255.8±422.73µs        ? ?/sec
sort partitioned i64                           1.00  253.8±407.60µs        ? ?/sec     1.02  258.9±563.71µs        ? ?/sec
sort partitioned mixed dictionary tuple        1.04  1007.0±251.99µs        ? ?/sec    1.00  963.7±285.48µs        ? ?/sec
sort partitioned mixed tuple                   1.07  761.1±465.06µs        ? ?/sec     1.00  711.4±330.09µs        ? ?/sec
sort partitioned mixed tuple with utf8 view    1.01      2.6±0.17ms        ? ?/sec     1.00      2.5±0.21ms        ? ?/sec
sort partitioned utf8 dictionary               1.13  292.5±416.48µs        ? ?/sec     1.00  258.9±280.26µs        ? ?/sec
sort partitioned utf8 dictionary tuple         1.05  893.0±161.00µs        ? ?/sec     1.00  853.1±171.36µs        ? ?/sec
sort partitioned utf8 high cardinality         1.00  404.8±172.46µs        ? ?/sec     1.06  428.0±356.77µs        ? ?/sec
sort partitioned utf8 low cardinality          1.06  462.2±277.57µs        ? ?/sec     1.00  434.3±194.57µs        ? ?/sec
sort partitioned utf8 tuple                    1.00      3.8±0.21ms        ? ?/sec     1.00      3.8±0.20ms        ? ?/sec
sort partitioned utf8 view high cardinality    1.02  1598.6±215.79µs        ? ?/sec    1.00  1569.9±221.13µs        ? ?/sec
sort partitioned utf8 view low cardinality     1.04  307.4±430.83µs        ? ?/sec     1.00  294.6±321.86µs        ? ?/sec
sort partitioned utf8 view tuple               1.03      3.3±0.14ms        ? ?/sec     1.00      3.2±0.11ms        ? ?/sec
sort utf8 dictionary                           1.00  1236.4±53.01µs        ? ?/sec     7.21      8.9±0.07ms        ? ?/sec
sort utf8 dictionary tuple                     1.06     14.5±0.50ms        ? ?/sec     1.00     13.8±0.30ms        ? ?/sec
sort utf8 high cardinality                     1.00     10.5±0.09ms        ? ?/sec     1.00     10.5±0.07ms        ? ?/sec
sort utf8 low cardinality                      1.00      7.9±0.19ms        ? ?/sec     1.01      7.9±0.44ms        ? ?/sec
sort utf8 tuple                                1.01     16.3±0.48ms        ? ?/sec     1.00     16.2±0.39ms        ? ?/sec
sort utf8 view high cardinality                1.00      9.7±0.44ms        ? ?/sec     1.00      9.7±0.21ms        ? ?/sec
sort utf8 view low cardinality                 1.00      6.7±0.10ms        ? ?/sec     1.01      6.7±0.13ms        ? ?/sec
sort utf8 view tuple                           1.01     15.6±0.44ms        ? ?/sec     1.00     15.4±0.27ms        ? ?/sec

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

physical-plan Changes to the physical-plan crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve memory resilience for ExternalSorter

5 participants