This is an automated email from the ASF dual-hosted git repository.
dongjoon-hyun pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/master by this push:
new e540d564a219 [SPARK-61277][SQL] Avoid quadratic allocations in
`ColumnPruning` when pruning the children of a `Union`
e540d564a219 is described below
commit e540d564a219d5e5f49ce383027fa52f7f206131
Author: Dongjoon Hyun <[email protected]>
AuthorDate: Mon Nov 9 21:09:30 2026 -0800
[SPARK-61277][SQL] Avoid quadratic allocations in `ColumnPruning` when
pruning the children of a `Union`
### What changes were proposed in this pull request?
This PR makes the `Union` case of `ColumnPruning` compute the output of the
first child and the set of attributes to keep once, instead of once per column
of each child.
```scala
// Before
val newOutput = prunedChild(firstChild, p.references).output
// pruning the columns of all children based on the pruned first child.
val newChildren = u.children.map { p =>
val selected = p.output.zipWithIndex.filter { case (a, i) =>
newOutput.contains(firstChild.output(i))
}.map(_._1)
```
```scala
// After
val firstChildOutput = firstChild.output.toIndexedSeq
val newOutputSet = AttributeSet(prunedChild(firstChild,
p.references).output)
// pruning the columns of all children based on the pruned first child.
val newChildren = u.children.map { p =>
val selected = p.output.zipWithIndex.filter { case (a, i) =>
newOutputSet.contains(firstChildOutput(i))
}.map(_._1)
```
The pruned plans stay the same. `newOutput` is the part of the first
child's output whose expression IDs are in `p.references`. Since
`AttributeReference.equals` also compares expression IDs,
`newOutput.contains(firstChild.output(i))` is true exactly when the expression
ID of `firstChild.output(i)` is in `p.references`. `AttributeSet.contains`
checks the same condition.
This PR also regenerates the `WideSchemaBenchmark` results. In the new
results, `optimize large union` with 10,000 columns takes 250 ms instead of
11,052 ms on JDK 21 (44x faster) and 197 ms instead of 11,812 ms on JDK 25 (60x
faster).
### Why are the changes needed?
For a `Union` of `C` children with `N` columns each, this case evaluates
`firstChild.output` `C * N` times, once per column of each child.
- `output` is not cached for many operators. `Project.output` is
`projectList.map(_.toAttribute)`, and `Alias.toAttribute` creates a new
`AttributeReference` on every call. So when the first child is a `Project` with
aliases, every evaluation creates `N` attributes and an `N`-element list, `C *
N^2` of each in total. `Aggregate`, `Window` and outer `Join` also build their
output on every call.
- `firstChild.output(i)` takes linear time when the output is a `List`.
- `newOutput.contains` is a linear search over the kept columns.
This case runs when a parent of a `Union` needs only some of its columns.
`ColumnPruning` puts a `Project` between them and prunes the children of the
`Union` in the same pass. For example, the `optimize large union` case of
`WideSchemaBenchmark` (SPARK-61281) optimizes this query with `N` = 100, 1,000
and 10,000:
```sql
SELECT a_1, count(*)
FROM (SELECT id + 1 AS a_1, id + 2 AS a_2, ..., id + N AS a_N FROM range(1)
UNION ALL
SELECT id + 1 AS b_1, id + 2 AS b_2, ..., id + N AS b_N FROM range(1))
GROUP BY a_1
```
A deterministic `Project` right above a `Union`, as in `SELECT a_1 FROM
(... UNION ALL ...)`, is usually pushed into the children by
`PushProjectionThroughUnion` before `ColumnPruning` runs. A non-deterministic
one reaches this case too.
The Best Time of `optimize large union` in the `WideSchemaBenchmark`
results, before (`master`) and after this PR. All results were generated by
GitHub Actions on AMD EPYC 7763.
| Columns (N) | JDK 21 before | JDK 21 after | JDK 25 before | JDK 25 after
|
|---:|---:|---:|---:|---:|
| 100 | 5 ms | 4 ms | 5 ms | 4 ms |
| 1,000 | 118 ms | 21 ms | 112 ms | 19 ms |
| 10,000 | 11,052 ms | 250 ms | 11,812 ms | 197 ms |
`optimize large cube` is also faster in the new results (10,000 columns:
8,384 ms to 4,458 ms on JDK 21) because SPARK-61295 was merged after the
previous results were generated. This PR does not change that case. The other
cases show only run-to-run variance.
The time and allocations of one `ColumnPruning` application on `Project(<1
column>, Union(Project(<N aliases>, t1), t2))`:
| Columns (N) | Time before | Time after | Allocated before | Allocated
after |
|---:|---:|---:|---:|---:|
| 1,000 | 33 ms | 1.4 ms | 245 MiB | 1.3 MiB |
| 2,000 | 119 ms | 0.8 ms | 979 MiB | 2.5 MiB |
| 5,000 | 709 ms | 1.4 ms | 6.0 GiB | 6.2 MiB |
| 10,000 | 2.83 s | 2.3 ms | 23.9 GiB | 12.4 MiB |
The allocations are the bytes that the calling thread allocated during the
call, measured with `ThreadMXBean.getCurrentThreadAllocatedBytes`. They are a
total over the call, mostly short-lived objects, not the peak heap usage.
This is not a regression. The case has evaluated `firstChild.output` for
each column since Spark 2.0 (SPARK-13376).
### Does this PR introduce _any_ user-facing change?
No. The optimized plans are the same. The optimizer only spends less time
and memory on a wide `Union`.
### How was this patch tested?
Pass the CIs with the existing tests, such as `Column pruning on Union` in
`ColumnPruningSuite`. All suites under
`org.apache.spark.sql.catalyst.optimizer` also pass locally.
```
build/sbt 'catalyst/testOnly org.apache.spark.sql.catalyst.optimizer.*'
```
The `WideSchemaBenchmark` results were generated by GitHub Actions with JDK
21 and 25.
The single-application numbers come from a local harness, which is not part
of this PR. The same harness also compared the plans before and after this PR
for 15 plans, both after one `ColumnPruning` application and after the
`ColumnPruningSuite` optimizer. The plans cover a first child with aliases,
alias metadata, duplicate expression IDs, an `Aggregate`, an outer `Join` or a
nested `Union`, three children, no referenced column, and an `Aggregate` above
the `Union`. All of them were [...]
### Was this patch authored or co-authored using generative AI tooling?
Generated-by: Claude Opus 5.5
Closes #60254 from dongjoon-hyun/SPARK-61277.
Authored-by: Dongjoon Hyun <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>
skip-checks: true
---
.../spark/sql/catalyst/optimizer/Optimizer.scala | 7 +-
.../WideSchemaBenchmark-jdk25-results.txt | 168 ++++++++++-----------
.../benchmarks/WideSchemaBenchmark-results.txt | 168 ++++++++++-----------
3 files changed, 173 insertions(+), 170 deletions(-)
diff --git
a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala
b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala
index 6d579616c7fd..cf0517b9816c 100644
---
a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala
+++
b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala
@@ -1575,11 +1575,14 @@ object ColumnPruning extends Rule[LogicalPlan] {
case p @ Project(_, u: Union) =>
if (!u.outputSet.subsetOf(p.references)) {
val firstChild = u.children.head
- val newOutput = prunedChild(firstChild, p.references).output
+ // Compute these once, not per column of each child: `output` may
create new attributes
+ // on each call (e.g. a `Project` with aliases), and a `Seq` lookup is
linear.
+ val firstChildOutput = firstChild.output.toIndexedSeq
+ val newOutputSet = AttributeSet(prunedChild(firstChild,
p.references).output)
// pruning the columns of all children based on the pruned first child.
val newChildren = u.children.map { p =>
val selected = p.output.zipWithIndex.filter { case (a, i) =>
- newOutput.contains(firstChild.output(i))
+ newOutputSet.contains(firstChildOutput(i))
}.map(_._1)
Project(selected, p)
}
diff --git a/sql/core/benchmarks/WideSchemaBenchmark-jdk25-results.txt
b/sql/core/benchmarks/WideSchemaBenchmark-jdk25-results.txt
index 747b1bec72bc..fad0c9c43a6e 100644
--- a/sql/core/benchmarks/WideSchemaBenchmark-jdk25-results.txt
+++ b/sql/core/benchmarks/WideSchemaBenchmark-jdk25-results.txt
@@ -6,9 +6,9 @@ OpenJDK 64-Bit Server VM 25.0.5.0.3+1-LTS on Linux
7.0.0-1017-azure
AMD EPYC 7763 64-Core Processor
parsing large select: Best Time(ms) Avg Time(ms)
Stdev(ms) Rate(M/s) Per Row(ns) Relative
------------------------------------------------------------------------------------------------------------------------
-1 select expressions 1 2
1 0.0 927427.0 1.0X
-100 select expressions 3 4
1 0.0 3203544.0 0.3X
-2500 select expressions 67 67
1 0.0 66700270.0 0.0X
+1 select expressions 1 1
0 0.0 846041.0 1.0X
+100 select expressions 3 4
1 0.0 3157873.0 0.3X
+2500 select expressions 66 67
1 0.0 66422365.0 0.0X
================================================================================================
@@ -19,9 +19,9 @@ OpenJDK 64-Bit Server VM 25.0.5.0.3+1-LTS on Linux
7.0.0-1017-azure
AMD EPYC 7763 64-Core Processor
optimize large select: Best Time(ms) Avg Time(ms)
Stdev(ms) Rate(M/s) Per Row(ns) Relative
------------------------------------------------------------------------------------------------------------------------
-100 columns 3 5
2 0.0 3292881.0 1.0X
-1000 columns 19 21
3 0.0 18506836.0 0.2X
-10000 columns 169 198
25 0.0 168631092.0 0.0X
+100 columns 3 4
1 0.0 2976355.0 1.0X
+1000 columns 17 18
3 0.0 16598471.0 0.2X
+10000 columns 159 189
17 0.0 159170020.0 0.0X
================================================================================================
@@ -32,9 +32,9 @@ OpenJDK 64-Bit Server VM 25.0.5.0.3+1-LTS on Linux
7.0.0-1017-azure
AMD EPYC 7763 64-Core Processor
optimize large union: Best Time(ms) Avg Time(ms)
Stdev(ms) Rate(M/s) Per Row(ns) Relative
------------------------------------------------------------------------------------------------------------------------
-100 columns 5 6
2 0.0 4564949.0 1.0X
-1000 columns 112 124
14 0.0 112026763.0 0.0X
-10000 columns 11812 12213
568 0.0 11811887713.0 0.0X
+100 columns 4 4
1 0.0 3509163.0 1.0X
+1000 columns 19 24
6 0.0 19416662.0 0.2X
+10000 columns 197 264
65 0.0 197207641.0 0.0X
================================================================================================
@@ -45,9 +45,9 @@ OpenJDK 64-Bit Server VM 25.0.5.0.3+1-LTS on Linux
7.0.0-1017-azure
AMD EPYC 7763 64-Core Processor
optimize large cube: Best Time(ms) Avg Time(ms)
Stdev(ms) Rate(M/s) Per Row(ns) Relative
------------------------------------------------------------------------------------------------------------------------
-100 columns 13 15
3 0.0 12999761.0 1.0X
-1000 columns 169 207
48 0.0 168529112.0 0.1X
-10000 columns 9267 9306
55 0.0 9266916114.0 0.0X
+100 columns 11 13
3 0.0 11477652.0 1.0X
+1000 columns 118 125
9 0.0 118177373.0 0.1X
+10000 columns 4017 4126
154 0.0 4017355017.0 0.0X
================================================================================================
@@ -58,18 +58,18 @@ OpenJDK 64-Bit Server VM 25.0.5.0.3+1-LTS on Linux
7.0.0-1017-azure
AMD EPYC 7763 64-Core Processor
many column field r/w: Best Time(ms) Avg Time(ms)
Stdev(ms) Rate(M/s) Per Row(ns) Relative
------------------------------------------------------------------------------------------------------------------------
-1 cols x 100000 rows (read in-mem) 20 27
6 5.0 198.5 1.0X
-1 cols x 100000 rows (exec in-mem) 19 24
5 5.4 185.6 1.1X
-1 cols x 100000 rows (read parquet) 34 44
9 3.0 337.9 0.6X
-1 cols x 100000 rows (write parquet) 101 116
13 1.0 1009.1 0.2X
-100 cols x 1000 rows (read in-mem) 15 19
4 6.7 148.7 1.3X
-100 cols x 1000 rows (exec in-mem) 17 24
6 5.9 169.6 1.2X
-100 cols x 1000 rows (read parquet) 29 37
8 3.5 289.8 0.7X
-100 cols x 1000 rows (write parquet) 92 105
9 1.1 923.7 0.2X
-2500 cols x 40 rows (read in-mem) 238 288
69 0.4 2376.9 0.1X
-2500 cols x 40 rows (exec in-mem) 266 356
91 0.4 2663.1 0.1X
-2500 cols x 40 rows (read parquet) 310 315
4 0.3 3102.9 0.1X
-2500 cols x 40 rows (write parquet) 324 384
86 0.3 3241.2 0.1X
+1 cols x 100000 rows (read in-mem) 16 24
7 6.2 162.0 1.0X
+1 cols x 100000 rows (exec in-mem) 15 20
6 6.8 147.1 1.1X
+1 cols x 100000 rows (read parquet) 30 44
10 3.3 304.0 0.5X
+1 cols x 100000 rows (write parquet) 91 102
13 1.1 913.0 0.2X
+100 cols x 1000 rows (read in-mem) 12 18
6 8.2 122.2 1.3X
+100 cols x 1000 rows (exec in-mem) 16 21
6 6.4 156.0 1.0X
+100 cols x 1000 rows (read parquet) 27 33
7 3.7 269.2 0.6X
+100 cols x 1000 rows (write parquet) 91 107
10 1.1 907.2 0.2X
+2500 cols x 40 rows (read in-mem) 212 228
18 0.5 2115.2 0.1X
+2500 cols x 40 rows (exec in-mem) 238 291
80 0.4 2378.1 0.1X
+2500 cols x 40 rows (read parquet) 308 315
5 0.3 3084.6 0.1X
+2500 cols x 40 rows (write parquet) 291 359
84 0.3 2907.8 0.1X
================================================================================================
@@ -80,18 +80,18 @@ OpenJDK 64-Bit Server VM 25.0.5.0.3+1-LTS on Linux
7.0.0-1017-azure
AMD EPYC 7763 64-Core Processor
wide shallowly nested struct field r/w: Best Time(ms) Avg Time(ms)
Stdev(ms) Rate(M/s) Per Row(ns) Relative
------------------------------------------------------------------------------------------------------------------------
-1 wide x 100000 rows (read in-mem) 25 34
8 4.1 245.9 1.0X
-1 wide x 100000 rows (exec in-mem) 26 35
7 3.8 262.1 0.9X
-1 wide x 100000 rows (read parquet) 26 34
7 3.8 264.2 0.9X
-1 wide x 100000 rows (write parquet) 104 114
10 1.0 1035.8 0.2X
-100 wide x 1000 rows (read in-mem) 19 23
6 5.3 188.2 1.3X
-100 wide x 1000 rows (exec in-mem) 21 27
5 4.7 213.1 1.2X
-100 wide x 1000 rows (read parquet) 27 33
7 3.8 265.3 0.9X
-100 wide x 1000 rows (write parquet) 99 107
8 1.0 988.9 0.2X
-2500 wide x 40 rows (read in-mem) 25 28
5 4.1 245.6 1.0X
-2500 wide x 40 rows (exec in-mem) 26 32
7 3.9 255.1 1.0X
-2500 wide x 40 rows (read parquet) 70 80
7 1.4 703.8 0.3X
-2500 wide x 40 rows (write parquet) 106 119
8 0.9 1058.2 0.2X
+1 wide x 100000 rows (read in-mem) 22 34
9 4.5 223.3 1.0X
+1 wide x 100000 rows (exec in-mem) 23 31
6 4.4 229.1 1.0X
+1 wide x 100000 rows (read parquet) 24 29
7 4.2 237.3 0.9X
+1 wide x 100000 rows (write parquet) 96 109
12 1.0 963.4 0.2X
+100 wide x 1000 rows (read in-mem) 16 22
7 6.2 162.6 1.4X
+100 wide x 1000 rows (exec in-mem) 17 23
7 5.9 169.3 1.3X
+100 wide x 1000 rows (read parquet) 23 28
7 4.3 234.1 1.0X
+100 wide x 1000 rows (write parquet) 92 104
14 1.1 918.4 0.2X
+2500 wide x 40 rows (read in-mem) 21 25
5 4.7 212.6 1.1X
+2500 wide x 40 rows (exec in-mem) 22 28
6 4.5 224.3 1.0X
+2500 wide x 40 rows (read parquet) 67 77
9 1.5 673.0 0.3X
+2500 wide x 40 rows (write parquet) 97 111
12 1.0 973.5 0.2X
================================================================================================
@@ -102,18 +102,18 @@ OpenJDK 64-Bit Server VM 25.0.5.0.3+1-LTS on Linux
7.0.0-1017-azure
AMD EPYC 7763 64-Core Processor
deeply nested struct field r/w: Best Time(ms) Avg Time(ms)
Stdev(ms) Rate(M/s) Per Row(ns) Relative
------------------------------------------------------------------------------------------------------------------------
-1 deep x 100000 rows (read in-mem) 18 22
6 5.4 184.9 1.0X
-1 deep x 100000 rows (exec in-mem) 21 25
6 4.8 206.9 0.9X
-1 deep x 100000 rows (read parquet) 22 27
7 4.6 216.0 0.9X
-1 deep x 100000 rows (write parquet) 99 108
8 1.0 988.4 0.2X
-100 deep x 1000 rows (read in-mem) 39 42
3 2.6 392.1 0.5X
-100 deep x 1000 rows (exec in-mem) 442 445
3 0.2 4417.8 0.0X
-100 deep x 1000 rows (read parquet) 457 461
3 0.2 4574.4 0.0X
-100 deep x 1000 rows (write parquet) 116 126
12 0.9 1161.6 0.2X
-250 deep x 400 rows (read in-mem) 151 155
4 0.7 1508.4 0.1X
-250 deep x 400 rows (exec in-mem) 2640 2649
13 0.0 26400.9 0.0X
-250 deep x 400 rows (read parquet) 2684 2685
1 0.0 26843.2 0.0X
-250 deep x 400 rows (write parquet) 228 237
7 0.4 2282.8 0.1X
+1 deep x 100000 rows (read in-mem) 16 19
6 6.2 162.3 1.0X
+1 deep x 100000 rows (exec in-mem) 18 22
5 5.5 182.9 0.9X
+1 deep x 100000 rows (read parquet) 19 23
6 5.2 193.6 0.8X
+1 deep x 100000 rows (write parquet) 93 109
15 1.1 927.9 0.2X
+100 deep x 1000 rows (read in-mem) 37 46
12 2.7 369.8 0.4X
+100 deep x 1000 rows (exec in-mem) 430 435
5 0.2 4302.9 0.0X
+100 deep x 1000 rows (read parquet) 437 455
19 0.2 4374.3 0.0X
+100 deep x 1000 rows (write parquet) 112 125
14 0.9 1118.6 0.1X
+250 deep x 400 rows (read in-mem) 149 154
4 0.7 1490.6 0.1X
+250 deep x 400 rows (exec in-mem) 2569 2573
5 0.0 25690.4 0.0X
+250 deep x 400 rows (read parquet) 2573 2585
17 0.0 25727.9 0.0X
+250 deep x 400 rows (write parquet) 225 232
11 0.4 2249.1 0.1X
================================================================================================
@@ -124,18 +124,18 @@ OpenJDK 64-Bit Server VM 25.0.5.0.3+1-LTS on Linux
7.0.0-1017-azure
AMD EPYC 7763 64-Core Processor
bushy struct field r/w: Best Time(ms) Avg Time(ms)
Stdev(ms) Rate(M/s) Per Row(ns) Relative
-------------------------------------------------------------------------------------------------------------------------
-1 x 1 deep x 100000 rows (read in-mem) 16 21
5 6.1 163.1 1.0X
-1 x 1 deep x 100000 rows (exec in-mem) 18 23
6 5.6 179.3 0.9X
-1 x 1 deep x 100000 rows (read parquet) 21 25
6 4.8 208.3 0.8X
-1 x 1 deep x 100000 rows (write parquet) 96 105
10 1.0 963.2 0.2X
-128 x 8 deep x 1000 rows (read in-mem) 16 21
5 6.1 162.9 1.0X
-128 x 8 deep x 1000 rows (exec in-mem) 17 21
5 6.0 165.4 1.0X
-128 x 8 deep x 1000 rows (read parquet) 24 28
5 4.2 239.4 0.7X
-128 x 8 deep x 1000 rows (write parquet) 93 101
9 1.1 926.0 0.2X
-1024 x 11 deep x 100 rows (read in-mem) 19 22
5 5.4 185.2 0.9X
-1024 x 11 deep x 100 rows (exec in-mem) 21 28
6 4.7 213.1 0.8X
-1024 x 11 deep x 100 rows (read parquet) 39 49
8 2.6 391.5 0.4X
-1024 x 11 deep x 100 rows (write parquet) 101 106
7 1.0 1008.8 0.2X
+1 x 1 deep x 100000 rows (read in-mem) 14 16
5 7.2 139.8 1.0X
+1 x 1 deep x 100000 rows (exec in-mem) 16 19
6 6.4 155.2 0.9X
+1 x 1 deep x 100000 rows (read parquet) 18 22
6 5.5 182.7 0.8X
+1 x 1 deep x 100000 rows (write parquet) 89 108
14 1.1 893.7 0.2X
+128 x 8 deep x 1000 rows (read in-mem) 14 17
6 7.2 139.1 1.0X
+128 x 8 deep x 1000 rows (exec in-mem) 15 19
5 6.7 150.0 0.9X
+128 x 8 deep x 1000 rows (read parquet) 21 26
7 4.7 213.3 0.7X
+128 x 8 deep x 1000 rows (write parquet) 89 101
11 1.1 886.6 0.2X
+1024 x 11 deep x 100 rows (read in-mem) 17 21
5 5.9 169.4 0.8X
+1024 x 11 deep x 100 rows (exec in-mem) 18 22
5 5.5 182.8 0.8X
+1024 x 11 deep x 100 rows (read parquet) 35 43
9 2.8 354.3 0.4X
+1024 x 11 deep x 100 rows (write parquet) 91 99
11 1.1 913.7 0.2X
================================================================================================
@@ -146,18 +146,18 @@ OpenJDK 64-Bit Server VM 25.0.5.0.3+1-LTS on Linux
7.0.0-1017-azure
AMD EPYC 7763 64-Core Processor
wide array field r/w: Best Time(ms) Avg Time(ms)
Stdev(ms) Rate(M/s) Per Row(ns) Relative
------------------------------------------------------------------------------------------------------------------------
-1 wide x 100000 rows (read in-mem) 18 21
4 5.6 179.5 1.0X
-1 wide x 100000 rows (exec in-mem) 21 25
5 4.8 207.5 0.9X
-1 wide x 100000 rows (read parquet) 21 27
8 4.9 206.0 0.9X
-1 wide x 100000 rows (write parquet) 99 104
8 1.0 988.0 0.2X
-100 wide x 1000 rows (read in-mem) 13 16
4 7.6 131.1 1.4X
-100 wide x 1000 rows (exec in-mem) 16 19
5 6.3 159.6 1.1X
-100 wide x 1000 rows (read parquet) 21 24
6 4.8 210.4 0.9X
-100 wide x 1000 rows (write parquet) 96 107
17 1.0 958.3 0.2X
-2500 wide x 40 rows (read in-mem) 13 16
5 7.8 128.0 1.4X
-2500 wide x 40 rows (exec in-mem) 14 17
5 6.9 144.7 1.2X
-2500 wide x 40 rows (read parquet) 20 23
6 5.1 195.5 0.9X
-2500 wide x 40 rows (write parquet) 109 115
7 0.9 1092.1 0.2X
+1 wide x 100000 rows (read in-mem) 15 20
6 6.6 151.9 1.0X
+1 wide x 100000 rows (exec in-mem) 17 22
5 5.8 173.9 0.9X
+1 wide x 100000 rows (read parquet) 18 22
6 5.5 182.7 0.8X
+1 wide x 100000 rows (write parquet) 89 100
14 1.1 890.2 0.2X
+100 wide x 1000 rows (read in-mem) 11 13
4 8.8 113.5 1.3X
+100 wide x 1000 rows (exec in-mem) 13 15
5 7.8 128.9 1.2X
+100 wide x 1000 rows (read parquet) 18 21
6 5.6 178.6 0.9X
+100 wide x 1000 rows (write parquet) 86 102
14 1.2 860.8 0.2X
+2500 wide x 40 rows (read in-mem) 11 14
5 8.8 113.0 1.3X
+2500 wide x 40 rows (exec in-mem) 13 15
4 7.9 126.2 1.2X
+2500 wide x 40 rows (read parquet) 18 20
5 5.7 175.2 0.9X
+2500 wide x 40 rows (write parquet) 86 100
14 1.2 860.7 0.2X
================================================================================================
@@ -168,17 +168,17 @@ OpenJDK 64-Bit Server VM 25.0.5.0.3+1-LTS on Linux
7.0.0-1017-azure
AMD EPYC 7763 64-Core Processor
wide map field r/w: Best Time(ms) Avg Time(ms)
Stdev(ms) Rate(M/s) Per Row(ns) Relative
------------------------------------------------------------------------------------------------------------------------
-1 wide x 100000 rows (read in-mem) 14 17
3 7.3 137.3 1.0X
-1 wide x 100000 rows (exec in-mem) 17 22
5 5.8 173.2 0.8X
-1 wide x 100000 rows (read parquet) 24 28
7 4.2 238.2 0.6X
-1 wide x 100000 rows (write parquet) 93 98
6 1.1 933.7 0.1X
-100 wide x 1000 rows (read in-mem) 8 10
2 11.8 84.8 1.6X
-100 wide x 1000 rows (exec in-mem) 10 13
3 9.9 101.1 1.4X
-100 wide x 1000 rows (read parquet) 22 28
7 4.6 215.3 0.6X
-100 wide x 1000 rows (write parquet) 87 92
6 1.1 874.5 0.2X
-2500 wide x 40 rows (read in-mem) 10 12
3 9.7 103.2 1.3X
-2500 wide x 40 rows (exec in-mem) 12 14
3 8.4 119.4 1.1X
-2500 wide x 40 rows (read parquet) 22 25
6 4.6 215.6 0.6X
-2500 wide x 40 rows (write parquet) 89 93
6 1.1 886.2 0.2X
+1 wide x 100000 rows (read in-mem) 12 15
4 8.2 121.9 1.0X
+1 wide x 100000 rows (exec in-mem) 16 24
5 6.3 158.0 0.8X
+1 wide x 100000 rows (read parquet) 21 26
6 4.7 214.6 0.6X
+1 wide x 100000 rows (write parquet) 86 93
11 1.2 864.7 0.1X
+100 wide x 1000 rows (read in-mem) 7 9
2 13.7 72.8 1.7X
+100 wide x 1000 rows (exec in-mem) 9 11
2 11.1 90.4 1.3X
+100 wide x 1000 rows (read parquet) 19 22
5 5.3 187.8 0.6X
+100 wide x 1000 rows (write parquet) 81 89
14 1.2 809.5 0.2X
+2500 wide x 40 rows (read in-mem) 9 10
3 11.2 89.3 1.4X
+2500 wide x 40 rows (exec in-mem) 11 12
3 9.4 106.1 1.1X
+2500 wide x 40 rows (read parquet) 19 23
6 5.2 191.6 0.6X
+2500 wide x 40 rows (write parquet) 83 90
11 1.2 833.7 0.1X
diff --git a/sql/core/benchmarks/WideSchemaBenchmark-results.txt
b/sql/core/benchmarks/WideSchemaBenchmark-results.txt
index c3e133a0aa3f..207ecd695355 100644
--- a/sql/core/benchmarks/WideSchemaBenchmark-results.txt
+++ b/sql/core/benchmarks/WideSchemaBenchmark-results.txt
@@ -6,9 +6,9 @@ OpenJDK 64-Bit Server VM 21.0.13.0.3+1-LTS on Linux
7.0.0-1017-azure
AMD EPYC 7763 64-Core Processor
parsing large select: Best Time(ms) Avg Time(ms)
Stdev(ms) Rate(M/s) Per Row(ns) Relative
------------------------------------------------------------------------------------------------------------------------
-1 select expressions 1 1
1 0.0 965260.0 1.0X
-100 select expressions 3 3
0 0.0 3040088.0 0.3X
-2500 select expressions 62 64
1 0.0 62289814.0 0.0X
+1 select expressions 1 2
1 0.0 997501.0 1.0X
+100 select expressions 3 3
0 0.0 3067854.0 0.3X
+2500 select expressions 62 64
2 0.0 62037778.0 0.0X
================================================================================================
@@ -19,9 +19,9 @@ OpenJDK 64-Bit Server VM 21.0.13.0.3+1-LTS on Linux
7.0.0-1017-azure
AMD EPYC 7763 64-Core Processor
optimize large select: Best Time(ms) Avg Time(ms)
Stdev(ms) Rate(M/s) Per Row(ns) Relative
------------------------------------------------------------------------------------------------------------------------
-100 columns 3 5
2 0.0 3336500.0 1.0X
-1000 columns 18 20
3 0.0 18355073.0 0.2X
-10000 columns 171 192
20 0.0 170518298.0 0.0X
+100 columns 3 4
1 0.0 3237840.0 1.0X
+1000 columns 19 19
1 0.0 18540012.0 0.2X
+10000 columns 177 183
5 0.0 177054053.0 0.0X
================================================================================================
@@ -32,9 +32,9 @@ OpenJDK 64-Bit Server VM 21.0.13.0.3+1-LTS on Linux
7.0.0-1017-azure
AMD EPYC 7763 64-Core Processor
optimize large union: Best Time(ms) Avg Time(ms)
Stdev(ms) Rate(M/s) Per Row(ns) Relative
------------------------------------------------------------------------------------------------------------------------
-100 columns 5 5
1 0.0 4564712.0 1.0X
-1000 columns 118 128
10 0.0 118330983.0 0.0X
-10000 columns 11052 11201
210 0.0 11052053752.0 0.0X
+100 columns 4 4
1 0.0 3755605.0 1.0X
+1000 columns 21 23
2 0.0 21317440.0 0.2X
+10000 columns 250 314
72 0.0 250244869.0 0.0X
================================================================================================
@@ -45,9 +45,9 @@ OpenJDK 64-Bit Server VM 21.0.13.0.3+1-LTS on Linux
7.0.0-1017-azure
AMD EPYC 7763 64-Core Processor
optimize large cube: Best Time(ms) Avg Time(ms)
Stdev(ms) Rate(M/s) Per Row(ns) Relative
------------------------------------------------------------------------------------------------------------------------
-100 columns 13 15
3 0.0 12770290.0 1.0X
-1000 columns 167 197
41 0.0 166817486.0 0.1X
-10000 columns 8384 8422
53 0.0 8384165788.0 0.0X
+100 columns 12 17
4 0.0 12099657.0 1.0X
+1000 columns 124 128
5 0.0 123884253.0 0.1X
+10000 columns 4458 4495
52 0.0 4458075586.0 0.0X
================================================================================================
@@ -58,18 +58,18 @@ OpenJDK 64-Bit Server VM 21.0.13.0.3+1-LTS on Linux
7.0.0-1017-azure
AMD EPYC 7763 64-Core Processor
many column field r/w: Best Time(ms) Avg Time(ms)
Stdev(ms) Rate(M/s) Per Row(ns) Relative
------------------------------------------------------------------------------------------------------------------------
-1 cols x 100000 rows (read in-mem) 18 25
8 5.5 181.4 1.0X
-1 cols x 100000 rows (exec in-mem) 18 23
5 5.7 176.5 1.0X
-1 cols x 100000 rows (read parquet) 34 45
11 2.9 341.4 0.5X
-1 cols x 100000 rows (write parquet) 110 121
13 0.9 1100.2 0.2X
-100 cols x 1000 rows (read in-mem) 15 19
5 6.9 145.7 1.2X
-100 cols x 1000 rows (exec in-mem) 17 22
6 6.0 166.0 1.1X
-100 cols x 1000 rows (read parquet) 28 40
10 3.5 284.8 0.6X
-100 cols x 1000 rows (write parquet) 107 118
14 0.9 1069.4 0.2X
-2500 cols x 40 rows (read in-mem) 241 326
93 0.4 2405.9 0.1X
-2500 cols x 40 rows (exec in-mem) 249 305
84 0.4 2491.3 0.1X
-2500 cols x 40 rows (read parquet) 316 344
28 0.3 3157.8 0.1X
-2500 cols x 40 rows (write parquet) 305 400
93 0.3 3045.2 0.1X
+1 cols x 100000 rows (read in-mem) 18 25
6 5.5 183.4 1.0X
+1 cols x 100000 rows (exec in-mem) 18 22
6 5.6 177.0 1.0X
+1 cols x 100000 rows (read parquet) 34 45
11 2.9 339.9 0.5X
+1 cols x 100000 rows (write parquet) 108 121
12 0.9 1083.5 0.2X
+100 cols x 1000 rows (read in-mem) 15 18
5 6.8 146.3 1.3X
+100 cols x 1000 rows (exec in-mem) 17 22
8 6.0 167.7 1.1X
+100 cols x 1000 rows (read parquet) 28 43
12 3.5 284.6 0.6X
+100 cols x 1000 rows (write parquet) 105 116
17 0.9 1054.2 0.2X
+2500 cols x 40 rows (read in-mem) 196 265
62 0.5 1957.3 0.1X
+2500 cols x 40 rows (exec in-mem) 223 295
94 0.4 2234.6 0.1X
+2500 cols x 40 rows (read parquet) 296 381
88 0.3 2959.8 0.1X
+2500 cols x 40 rows (write parquet) 288 313
22 0.3 2880.3 0.1X
================================================================================================
@@ -80,18 +80,18 @@ OpenJDK 64-Bit Server VM 21.0.13.0.3+1-LTS on Linux
7.0.0-1017-azure
AMD EPYC 7763 64-Core Processor
wide shallowly nested struct field r/w: Best Time(ms) Avg Time(ms)
Stdev(ms) Rate(M/s) Per Row(ns) Relative
------------------------------------------------------------------------------------------------------------------------
-1 wide x 100000 rows (read in-mem) 24 35
10 4.2 240.1 1.0X
-1 wide x 100000 rows (exec in-mem) 25 35
7 4.0 253.2 0.9X
-1 wide x 100000 rows (read parquet) 26 32
7 3.8 264.0 0.9X
-1 wide x 100000 rows (write parquet) 115 126
10 0.9 1147.5 0.2X
-100 wide x 1000 rows (read in-mem) 19 24
8 5.3 189.2 1.3X
-100 wide x 1000 rows (exec in-mem) 20 28
7 4.9 204.2 1.2X
-100 wide x 1000 rows (read parquet) 27 34
8 3.6 274.9 0.9X
-100 wide x 1000 rows (write parquet) 110 120
9 0.9 1099.7 0.2X
-2500 wide x 40 rows (read in-mem) 25 31
6 4.0 250.9 1.0X
-2500 wide x 40 rows (exec in-mem) 26 34
7 3.9 257.2 0.9X
-2500 wide x 40 rows (read parquet) 73 84
8 1.4 730.7 0.3X
-2500 wide x 40 rows (write parquet) 119 134
11 0.8 1186.0 0.2X
+1 wide x 100000 rows (read in-mem) 24 35
11 4.1 242.3 1.0X
+1 wide x 100000 rows (exec in-mem) 26 33
10 3.8 260.3 0.9X
+1 wide x 100000 rows (read parquet) 26 35
9 3.9 259.3 0.9X
+1 wide x 100000 rows (write parquet) 136 149
16 0.7 1356.2 0.2X
+100 wide x 1000 rows (read in-mem) 19 23
6 5.2 191.6 1.3X
+100 wide x 1000 rows (exec in-mem) 21 27
8 4.8 208.6 1.2X
+100 wide x 1000 rows (read parquet) 27 35
10 3.7 269.0 0.9X
+100 wide x 1000 rows (write parquet) 112 126
14 0.9 1116.8 0.2X
+2500 wide x 40 rows (read in-mem) 26 30
7 3.9 259.0 0.9X
+2500 wide x 40 rows (exec in-mem) 28 37
6 3.6 278.8 0.9X
+2500 wide x 40 rows (read parquet) 74 85
11 1.4 737.5 0.3X
+2500 wide x 40 rows (write parquet) 115 127
12 0.9 1151.2 0.2X
================================================================================================
@@ -102,18 +102,18 @@ OpenJDK 64-Bit Server VM 21.0.13.0.3+1-LTS on Linux
7.0.0-1017-azure
AMD EPYC 7763 64-Core Processor
deeply nested struct field r/w: Best Time(ms) Avg Time(ms)
Stdev(ms) Rate(M/s) Per Row(ns) Relative
------------------------------------------------------------------------------------------------------------------------
-1 deep x 100000 rows (read in-mem) 19 22
5 5.4 185.9 1.0X
-1 deep x 100000 rows (exec in-mem) 21 26
7 4.7 210.9 0.9X
-1 deep x 100000 rows (read parquet) 22 27
7 4.6 219.4 0.8X
-1 deep x 100000 rows (write parquet) 110 118
11 0.9 1095.7 0.2X
-100 deep x 1000 rows (read in-mem) 52 60
7 1.9 520.9 0.4X
-100 deep x 1000 rows (exec in-mem) 479 485
6 0.2 4794.9 0.0X
-100 deep x 1000 rows (read parquet) 476 490
8 0.2 4761.0 0.0X
-100 deep x 1000 rows (write parquet) 143 151
10 0.7 1425.2 0.1X
-250 deep x 400 rows (read in-mem) 225 231
4 0.4 2252.1 0.1X
-250 deep x 400 rows (exec in-mem) 2886 2891
7 0.0 28864.7 0.0X
-250 deep x 400 rows (read parquet) 2835 2843
11 0.0 28352.7 0.0X
-250 deep x 400 rows (write parquet) 317 324
8 0.3 3167.7 0.1X
+1 deep x 100000 rows (read in-mem) 19 24
7 5.2 192.5 1.0X
+1 deep x 100000 rows (exec in-mem) 22 28
9 4.6 216.9 0.9X
+1 deep x 100000 rows (read parquet) 23 28
6 4.4 225.1 0.9X
+1 deep x 100000 rows (write parquet) 109 127
14 0.9 1090.1 0.2X
+100 deep x 1000 rows (read in-mem) 49 54
6 2.0 488.3 0.4X
+100 deep x 1000 rows (exec in-mem) 488 494
5 0.2 4881.0 0.0X
+100 deep x 1000 rows (read parquet) 500 511
9 0.2 5004.8 0.0X
+100 deep x 1000 rows (write parquet) 142 157
12 0.7 1416.8 0.1X
+250 deep x 400 rows (read in-mem) 202 211
11 0.5 2022.7 0.1X
+250 deep x 400 rows (exec in-mem) 2976 2979
4 0.0 29763.7 0.0X
+250 deep x 400 rows (read parquet) 2950 2954
6 0.0 29499.7 0.0X
+250 deep x 400 rows (write parquet) 295 305
11 0.3 2951.5 0.1X
================================================================================================
@@ -124,18 +124,18 @@ OpenJDK 64-Bit Server VM 21.0.13.0.3+1-LTS on Linux
7.0.0-1017-azure
AMD EPYC 7763 64-Core Processor
bushy struct field r/w: Best Time(ms) Avg Time(ms)
Stdev(ms) Rate(M/s) Per Row(ns) Relative
-------------------------------------------------------------------------------------------------------------------------
-1 x 1 deep x 100000 rows (read in-mem) 16 21
5 6.1 164.3 1.0X
-1 x 1 deep x 100000 rows (exec in-mem) 18 22
6 5.6 178.3 0.9X
-1 x 1 deep x 100000 rows (read parquet) 21 25
6 4.8 207.9 0.8X
-1 x 1 deep x 100000 rows (write parquet) 105 119
16 1.0 1050.4 0.2X
-128 x 8 deep x 1000 rows (read in-mem) 16 21
6 6.2 161.9 1.0X
-128 x 8 deep x 1000 rows (exec in-mem) 20 25
5 5.0 200.3 0.8X
-128 x 8 deep x 1000 rows (read parquet) 24 31
7 4.1 244.3 0.7X
-128 x 8 deep x 1000 rows (write parquet) 105 113
10 1.0 1047.4 0.2X
-1024 x 11 deep x 100 rows (read in-mem) 19 21
4 5.2 193.1 0.9X
-1024 x 11 deep x 100 rows (exec in-mem) 21 26
6 4.7 210.9 0.8X
-1024 x 11 deep x 100 rows (read parquet) 39 50
8 2.5 393.6 0.4X
-1024 x 11 deep x 100 rows (write parquet) 109 117
9 0.9 1090.7 0.2X
+1 x 1 deep x 100000 rows (read in-mem) 16 19
6 6.3 157.5 1.0X
+1 x 1 deep x 100000 rows (exec in-mem) 18 24
7 5.4 183.7 0.9X
+1 x 1 deep x 100000 rows (read parquet) 22 27
7 4.6 219.2 0.7X
+1 x 1 deep x 100000 rows (write parquet) 107 115
8 0.9 1071.0 0.1X
+128 x 8 deep x 1000 rows (read in-mem) 17 23
7 5.9 169.8 0.9X
+128 x 8 deep x 1000 rows (exec in-mem) 19 24
6 5.2 192.5 0.8X
+128 x 8 deep x 1000 rows (read parquet) 27 35
8 3.7 268.1 0.6X
+128 x 8 deep x 1000 rows (write parquet) 108 119
11 0.9 1077.0 0.1X
+1024 x 11 deep x 100 rows (read in-mem) 21 23
5 4.8 208.5 0.8X
+1024 x 11 deep x 100 rows (exec in-mem) 22 30
6 4.5 223.6 0.7X
+1024 x 11 deep x 100 rows (read parquet) 41 52
9 2.5 406.9 0.4X
+1024 x 11 deep x 100 rows (write parquet) 114 125
12 0.9 1141.4 0.1X
================================================================================================
@@ -146,18 +146,18 @@ OpenJDK 64-Bit Server VM 21.0.13.0.3+1-LTS on Linux
7.0.0-1017-azure
AMD EPYC 7763 64-Core Processor
wide array field r/w: Best Time(ms) Avg Time(ms)
Stdev(ms) Rate(M/s) Per Row(ns) Relative
------------------------------------------------------------------------------------------------------------------------
-1 wide x 100000 rows (read in-mem) 17 22
6 5.7 174.0 1.0X
-1 wide x 100000 rows (exec in-mem) 20 25
5 5.0 201.2 0.9X
-1 wide x 100000 rows (read parquet) 21 26
6 4.7 212.1 0.8X
-1 wide x 100000 rows (write parquet) 107 118
13 0.9 1068.3 0.2X
-100 wide x 1000 rows (read in-mem) 13 16
6 7.5 132.6 1.3X
-100 wide x 1000 rows (exec in-mem) 15 19
6 6.6 152.2 1.1X
-100 wide x 1000 rows (read parquet) 20 24
6 4.9 203.8 0.9X
-100 wide x 1000 rows (write parquet) 105 116
14 1.0 1049.5 0.2X
-2500 wide x 40 rows (read in-mem) 13 17
6 7.6 131.6 1.3X
-2500 wide x 40 rows (exec in-mem) 15 17
5 6.7 149.0 1.2X
-2500 wide x 40 rows (read parquet) 20 23
6 5.1 196.7 0.9X
-2500 wide x 40 rows (write parquet) 103 114
11 1.0 1029.6 0.2X
+1 wide x 100000 rows (read in-mem) 19 24
5 5.4 186.3 1.0X
+1 wide x 100000 rows (exec in-mem) 21 28
6 4.9 205.9 0.9X
+1 wide x 100000 rows (read parquet) 21 27
8 4.8 208.9 0.9X
+1 wide x 100000 rows (write parquet) 108 120
14 0.9 1083.2 0.2X
+100 wide x 1000 rows (read in-mem) 13 16
5 7.8 127.5 1.5X
+100 wide x 1000 rows (exec in-mem) 14 18
5 7.0 143.9 1.3X
+100 wide x 1000 rows (read parquet) 20 24
8 5.1 195.0 1.0X
+100 wide x 1000 rows (write parquet) 102 115
19 1.0 1025.0 0.2X
+2500 wide x 40 rows (read in-mem) 12 16
5 8.0 124.9 1.5X
+2500 wide x 40 rows (exec in-mem) 14 17
5 7.1 141.6 1.3X
+2500 wide x 40 rows (read parquet) 20 24
6 5.1 197.4 0.9X
+2500 wide x 40 rows (write parquet) 102 116
14 1.0 1023.1 0.2X
================================================================================================
@@ -168,17 +168,17 @@ OpenJDK 64-Bit Server VM 21.0.13.0.3+1-LTS on Linux
7.0.0-1017-azure
AMD EPYC 7763 64-Core Processor
wide map field r/w: Best Time(ms) Avg Time(ms)
Stdev(ms) Rate(M/s) Per Row(ns) Relative
------------------------------------------------------------------------------------------------------------------------
-1 wide x 100000 rows (read in-mem) 14 17
4 7.2 137.9 1.0X
-1 wide x 100000 rows (exec in-mem) 16 19
4 6.1 164.0 0.8X
-1 wide x 100000 rows (read parquet) 24 31
7 4.2 240.8 0.6X
-1 wide x 100000 rows (write parquet) 103 105
5 1.0 1027.1 0.1X
-100 wide x 1000 rows (read in-mem) 8 10
2 11.8 84.4 1.6X
-100 wide x 1000 rows (exec in-mem) 10 13
3 9.6 104.2 1.3X
-100 wide x 1000 rows (read parquet) 22 26
6 4.5 220.8 0.6X
-100 wide x 1000 rows (write parquet) 97 102
6 1.0 970.5 0.1X
-2500 wide x 40 rows (read in-mem) 10 12
3 9.7 103.4 1.3X
-2500 wide x 40 rows (exec in-mem) 12 16
4 8.2 122.1 1.1X
-2500 wide x 40 rows (read parquet) 22 26
6 4.6 218.3 0.6X
-2500 wide x 40 rows (write parquet) 98 105
7 1.0 984.7 0.1X
+1 wide x 100000 rows (read in-mem) 13 18
5 7.6 131.7 1.0X
+1 wide x 100000 rows (exec in-mem) 17 21
6 6.0 167.5 0.8X
+1 wide x 100000 rows (read parquet) 23 29
7 4.3 230.6 0.6X
+1 wide x 100000 rows (write parquet) 101 107
11 1.0 1005.4 0.1X
+100 wide x 1000 rows (read in-mem) 8 9
3 12.7 78.7 1.7X
+100 wide x 1000 rows (exec in-mem) 10 12
4 10.2 97.6 1.3X
+100 wide x 1000 rows (read parquet) 21 26
7 4.9 205.8 0.6X
+100 wide x 1000 rows (write parquet) 97 104
11 1.0 973.6 0.1X
+2500 wide x 40 rows (read in-mem) 10 11
3 10.2 97.8 1.3X
+2500 wide x 40 rows (exec in-mem) 12 15
4 8.5 117.1 1.1X
+2500 wide x 40 rows (read parquet) 21 26
7 4.8 207.8 0.6X
+2500 wide x 40 rows (write parquet) 98 106
13 1.0 978.9 0.1X
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]