Commit 36e3415
authored
Optimize
* Add benchmark for `with_param_values`
Target of this benchmark: control that placeholders replacing does not get slower,
if the query does not contain placeholders at all.
* Do not save original expression name if it does not contain placeholders
Prior this patch, the original expression name was unconditionally preserved during the replacement of placeholders.
However, in some cases, this is unnecessary. If the expression does not contain any placeholders, its name remains unchanged, and we do not need to preserve it.
This patch adds the following optimization:
- If during first pass (placeholders type inference) was investigated that there are no placeholders, do not save the original name,
do not apply second pass (replacing).
Just leave the expression as it is and return `Transformed::no(...)`.replace_params_with_values (#13308)1 parent 31d27c2 commit 36e3415
File tree
4 files changed
+51
-7
lines changed- datafusion
- core/benches
- expr/src
- logical_plan
- sql/src/expr
4 files changed
+51
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
| 30 | + | |
29 | 31 | | |
30 | 32 | | |
31 | 33 | | |
| |||
122 | 124 | | |
123 | 125 | | |
124 | 126 | | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
125 | 150 | | |
126 | 151 | | |
127 | 152 | | |
| |||
388 | 413 | | |
389 | 414 | | |
390 | 415 | | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
391 | 420 | | |
392 | 421 | | |
393 | 422 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1598 | 1598 | | |
1599 | 1599 | | |
1600 | 1600 | | |
1601 | | - | |
| 1601 | + | |
| 1602 | + | |
| 1603 | + | |
| 1604 | + | |
| 1605 | + | |
1602 | 1606 | | |
1603 | 1607 | | |
1604 | 1608 | | |
| |||
1615 | 1619 | | |
1616 | 1620 | | |
1617 | 1621 | | |
| 1622 | + | |
| 1623 | + | |
| 1624 | + | |
1618 | 1625 | | |
1619 | 1626 | | |
1620 | 1627 | | |
| 1628 | + | |
1621 | 1629 | | |
1622 | 1630 | | |
1623 | 1631 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1413 | 1413 | | |
1414 | 1414 | | |
1415 | 1415 | | |
1416 | | - | |
1417 | | - | |
1418 | | - | |
| 1416 | + | |
| 1417 | + | |
| 1418 | + | |
| 1419 | + | |
| 1420 | + | |
| 1421 | + | |
| 1422 | + | |
| 1423 | + | |
| 1424 | + | |
1419 | 1425 | | |
1420 | 1426 | | |
1421 | 1427 | | |
1422 | 1428 | | |
1423 | 1429 | | |
1424 | 1430 | | |
1425 | 1431 | | |
1426 | | - | |
1427 | | - | |
| 1432 | + | |
| 1433 | + | |
| 1434 | + | |
1428 | 1435 | | |
1429 | 1436 | | |
1430 | 1437 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
143 | | - | |
| 143 | + | |
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
| |||
0 commit comments