forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit513f447

Richard Guo
Reduce memory used by partitionwise joins
In try_partitionwise_join, we aim to break down the join between twopartitioned relations into joins between matching partitions. Toachieve this, we iterate through each pair of partitions from the twojoining relations and create child-join relations for them. Withpotentially thousands of partitions, the local objects allocated ineach iteration can accumulate significant memory usage. Therefore, weopt to eagerly free these local objects at the end of each iteration.In line with this approach, this patch frees the bitmap set thatrepresents the relids of child-join relations at the end of eachiteration. Additionally, it modifies build_child_join_rel() to reusethe AppendRelInfo structures generated within each iteration.Author: Ashutosh BapatReviewed-by: David Christensen, Richard GuoDiscussion:https://postgr.es/m/CAExHW5s4EqY43oB=ne6B2=-xLgrs9ZGeTr1NXwkGFt2j-OmaQQ@mail.gmail.com1 parentf47b33a commit513f447
File tree
3 files changed
+16
-20
lines changed- src
- backend/optimizer
- path
- util
- include/optimizer
3 files changed
+16
-20
lines changedLines changed: 11 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1547 | 1547 |
| |
1548 | 1548 |
| |
1549 | 1549 |
| |
| 1550 | + | |
1550 | 1551 |
| |
1551 | 1552 |
| |
1552 | 1553 |
| |
| |||
1642 | 1643 |
| |
1643 | 1644 |
| |
1644 | 1645 |
| |
1645 |
| - | |
1646 |
| - | |
1647 |
| - | |
| 1646 | + | |
| 1647 | + | |
1648 | 1648 |
| |
1649 | 1649 |
| |
1650 | 1650 |
| |
| |||
1662 | 1662 |
| |
1663 | 1663 |
| |
1664 | 1664 |
| |
1665 |
| - | |
| 1665 | + | |
1666 | 1666 |
| |
1667 | 1667 |
| |
1668 | 1668 |
| |
| |||
1679 | 1679 |
| |
1680 | 1680 |
| |
1681 | 1681 |
| |
| 1682 | + | |
| 1683 | + | |
| 1684 | + | |
| 1685 | + | |
| 1686 | + | |
| 1687 | + | |
1682 | 1688 |
| |
| 1689 | + | |
1683 | 1690 |
| |
1684 | 1691 |
| |
1685 | 1692 |
| |
|
Lines changed: 3 additions & 15 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
876 | 876 |
| |
877 | 877 |
| |
878 | 878 |
| |
| 879 | + | |
879 | 880 |
| |
880 | 881 |
| |
881 | 882 |
| |
882 | 883 |
| |
883 |
| - | |
| 884 | + | |
| 885 | + | |
884 | 886 |
| |
885 | 887 |
| |
886 |
| - | |
887 |
| - | |
888 | 888 |
| |
889 | 889 |
| |
890 | 890 |
| |
891 | 891 |
| |
892 | 892 |
| |
893 | 893 |
| |
894 | 894 |
| |
895 |
| - | |
896 |
| - | |
897 |
| - | |
898 |
| - | |
899 |
| - | |
900 |
| - | |
901 |
| - | |
902 |
| - | |
903 |
| - | |
904 |
| - | |
905 | 895 |
| |
906 | 896 |
| |
907 | 897 |
| |
| |||
1017 | 1007 |
| |
1018 | 1008 |
| |
1019 | 1009 |
| |
1020 |
| - | |
1021 |
| - | |
1022 | 1010 |
| |
1023 | 1011 |
| |
1024 | 1012 |
| |
|
Lines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
346 | 346 |
| |
347 | 347 |
| |
348 | 348 |
| |
349 |
| - | |
| 349 | + | |
| 350 | + | |
350 | 351 |
| |
351 | 352 |
|
0 commit comments
Comments
(0)