Commit ce2c5d9
authored
Fix TopN row size estimate (#119476)
Currently, we only account for attributes after the TopN operation when
estimating its row size. This results in invalid estimates for the final
TopN on the coordinator and the node-level reduction TopN. This change
corrects the estimates and removes the workaround, paving the way for
enabling node-level reduction in ES|QL.
Closes #1069561 parent 8ca74fb commit ce2c5d9
File tree
5 files changed
+45
-25
lines changed- docs/changelog
- x-pack/plugin/esql/src
- main/java/org/elasticsearch/xpack/esql
- planner
- plan/physical
- test/java/org/elasticsearch/xpack/esql/optimizer
5 files changed
+45
-25
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
Lines changed: 0 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | 106 | | |
110 | 107 | | |
111 | 108 | | |
| |||
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| 17 | + | |
16 | 18 | | |
17 | 19 | | |
18 | 20 | | |
| |||
95 | 97 | | |
96 | 98 | | |
97 | 99 | | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
98 | 103 | | |
99 | 104 | | |
100 | 105 | | |
| |||
Lines changed: 3 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
345 | 345 | | |
346 | 346 | | |
347 | 347 | | |
| 348 | + | |
| 349 | + | |
348 | 350 | | |
349 | 351 | | |
350 | 352 | | |
| |||
385 | 387 | | |
386 | 388 | | |
387 | 389 | | |
388 | | - | |
389 | | - | |
390 | | - | |
391 | | - | |
392 | | - | |
393 | | - | |
394 | | - | |
395 | | - | |
396 | | - | |
397 | | - | |
398 | 390 | | |
399 | | - | |
400 | | - | |
401 | | - | |
402 | | - | |
403 | | - | |
404 | | - | |
405 | | - | |
| 391 | + | |
406 | 392 | | |
407 | 393 | | |
408 | 394 | | |
| |||
Lines changed: 31 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
| 146 | + | |
146 | 147 | | |
147 | 148 | | |
148 | 149 | | |
| |||
920 | 921 | | |
921 | 922 | | |
922 | 923 | | |
923 | | - | |
924 | | - | |
| 924 | + | |
| 925 | + | |
925 | 926 | | |
926 | 927 | | |
927 | 928 | | |
928 | 929 | | |
929 | 930 | | |
930 | 931 | | |
931 | 932 | | |
932 | | - | |
| 933 | + | |
933 | 934 | | |
934 | 935 | | |
935 | 936 | | |
| |||
1141 | 1142 | | |
1142 | 1143 | | |
1143 | 1144 | | |
1144 | | - | |
1145 | | - | |
| 1145 | + | |
| 1146 | + | |
1146 | 1147 | | |
1147 | 1148 | | |
1148 | 1149 | | |
| |||
7650 | 7651 | | |
7651 | 7652 | | |
7652 | 7653 | | |
| 7654 | + | |
| 7655 | + | |
| 7656 | + | |
| 7657 | + | |
| 7658 | + | |
| 7659 | + | |
| 7660 | + | |
| 7661 | + | |
| 7662 | + | |
| 7663 | + | |
| 7664 | + | |
| 7665 | + | |
| 7666 | + | |
| 7667 | + | |
| 7668 | + | |
| 7669 | + | |
| 7670 | + | |
| 7671 | + | |
| 7672 | + | |
| 7673 | + | |
| 7674 | + | |
| 7675 | + | |
| 7676 | + | |
| 7677 | + | |
| 7678 | + | |
7653 | 7679 | | |
7654 | 7680 | | |
7655 | 7681 | | |
| |||
0 commit comments