Repository navigation
Commit 350ca76
authored
perf: deduplicate found expressions with an IndexSet (#26474)
I've got a few fixes to upstream so just starting with small ones.
## Which issue does this PR close?
<!--
We generally require a GitHub issue to be filed for all bug fixes and
enhancements and this helps us generate change logs for our releases.
You can link an issue to this PR using the GitHub syntax. For example
`Closes #123` indicates that this PR will close issue #123.
-->
- Closes #26473
## Rationale for this change
`find_exprs_in_exprs` and `find_exprs_in_expr` deduplicate with
`Vec::contains`, which is quadratic in the number of distinct matches.
On 20,000 distinct aggregates `find_aggregate_exprs` takes 932 ms; with
this change it takes 2.8 ms (release build, see the issue for the full
table).
## What changes are included in this PR?
Both functions now collect into a single index set.
## Are there any user-facing changes?
No1 parent 51a4bfc commit 350ca76
1 file changed
Lines changed: 29 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
862 | 862 | | |
863 | 863 | | |
864 | 864 | | |
865 | | - | |
866 | | - | |
867 | | - | |
868 | | - | |
869 | | - | |
870 | | - | |
871 | | - | |
872 | | - | |
873 | | - | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
874 | 870 | | |
875 | 871 | | |
876 | 872 | | |
| |||
880 | 876 | | |
881 | 877 | | |
882 | 878 | | |
883 | | - | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
884 | 886 | | |
885 | 887 | | |
886 | | - | |
887 | | - | |
| 888 | + | |
| 889 | + | |
888 | 890 | | |
889 | 891 | | |
890 | 892 | | |
| |||
894 | 896 | | |
895 | 897 | | |
896 | 898 | | |
897 | | - | |
898 | 899 | | |
899 | 900 | | |
900 | 901 | | |
| |||
1666 | 1667 | | |
1667 | 1668 | | |
1668 | 1669 | | |
| 1670 | + | |
| 1671 | + | |
| 1672 | + | |
| 1673 | + | |
| 1674 | + | |
| 1675 | + | |
| 1676 | + | |
| 1677 | + | |
| 1678 | + | |
| 1679 | + | |
| 1680 | + | |
| 1681 | + | |
| 1682 | + | |
| 1683 | + | |
| 1684 | + | |
1669 | 1685 | | |
1670 | 1686 | | |
1671 | 1687 | | |
| |||
0 commit comments