forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit6630cca
committed
Restructure creation of run-time pruning steps.
Previously, gen_partprune_steps() always built executor pruning stepsusing all suitable clauses, including those containing PARAM_EXECParams. This meant that the pruning steps were only completely safefor executor run-time (scan start) pruning. To prune at executorstartup, we had to ignore the steps involving exec Params. But thisdoesn't really work in general, since there may be logic changesneeded as well --- for example, pruning according to the last operator'sbtree strategy is the wrong thing if we're not applying that operator.The rules embodied in gen_partprune_steps() and its minions aresufficiently complicated that tracking their incremental effects inother logic seems quite impractical.Short of a complete redesign, the only safe fix seems to be to rungen_partprune_steps() twice, once to create executor startup pruningsteps and then again for run-time pruning steps. We can save a fewcycles however by noting during the first scan whether we rejectedany clauses because they involved exec Params --- if not, we don'tneed to do the second scan.In support of this, refactor the internal APIs in partprune.c to makemore use of passing information in the GeneratePruningStepsContextstruct, rather than as separate arguments.This is, I hope, the last piece of our response to a bug report fromAlan Jackson. Back-patch to v11 where this code came in.Discussion:https://postgr.es/m/FAD28A83-AC73-489E-A058-2681FA31D648@tvsquared.com1 parent0568589 commit6630cca
File tree
10 files changed
+614
-484
lines changed- src
- backend
- executor
- nodes
- partitioning
- include
- executor
- nodes
- partitioning
- test/regress
- expected
- sql
10 files changed
+614
-484
lines changedLines changed: 105 additions & 75 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
183 | 183 |
| |
184 | 184 |
| |
185 | 185 |
| |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
186 | 191 |
| |
187 | 192 |
| |
188 | 193 |
| |
| |||
1614 | 1619 |
| |
1615 | 1620 |
| |
1616 | 1621 |
| |
1617 |
| - | |
1618 | 1622 |
| |
1619 | 1623 |
| |
1620 | 1624 |
| |
1621 |
| - | |
1622 |
| - | |
1623 |
| - | |
1624 |
| - | |
1625 |
| - | |
1626 |
| - | |
1627 | 1625 |
| |
1628 | 1626 |
| |
1629 | 1627 |
| |
| |||
1643 | 1641 |
| |
1644 | 1642 |
| |
1645 | 1643 |
| |
| 1644 | + | |
1646 | 1645 |
| |
1647 | 1646 |
| |
1648 | 1647 |
| |
| |||
1700 | 1699 |
| |
1701 | 1700 |
| |
1702 | 1701 |
| |
1703 |
| - | |
1704 |
| - | |
1705 |
| - | |
1706 |
| - | |
1707 |
| - | |
1708 |
| - | |
1709 |
| - | |
1710 |
| - | |
1711 |
| - | |
1712 |
| - | |
1713 |
| - | |
1714 |
| - | |
1715 |
| - | |
1716 |
| - | |
1717 |
| - | |
| 1702 | + | |
| 1703 | + | |
1718 | 1704 |
| |
1719 |
| - | |
1720 |
| - | |
1721 |
| - | |
1722 |
| - | |
| 1705 | + | |
| 1706 | + | |
| 1707 | + | |
| 1708 | + | |
| 1709 | + | |
1723 | 1710 |
| |
1724 |
| - | |
1725 |
| - | |
1726 |
| - | |
1727 |
| - | |
1728 |
| - | |
1729 |
| - | |
1730 |
| - | |
1731 |
| - | |
1732 |
| - | |
1733 |
| - | |
1734 |
| - | |
1735 |
| - | |
1736 |
| - | |
1737 |
| - | |
1738 |
| - | |
1739 |
| - | |
1740 |
| - | |
1741 |
| - | |
1742 |
| - | |
1743 |
| - | |
1744 |
| - | |
1745 |
| - | |
1746 |
| - | |
1747 |
| - | |
1748 |
| - | |
1749 |
| - | |
1750 |
| - | |
| 1711 | + | |
| 1712 | + | |
| 1713 | + | |
| 1714 | + | |
| 1715 | + | |
| 1716 | + | |
| 1717 | + | |
| 1718 | + | |
| 1719 | + | |
| 1720 | + | |
| 1721 | + | |
| 1722 | + | |
| 1723 | + | |
| 1724 | + | |
1751 | 1725 |
| |
1752 |
| - | |
1753 |
| - | |
1754 |
| - | |
1755 |
| - | |
1756 |
| - | |
1757 |
| - | |
1758 |
| - | |
1759 |
| - | |
1760 |
| - | |
1761 |
| - | |
1762 |
| - | |
1763 | 1726 |
| |
1764 | 1727 |
| |
1765 | 1728 |
| |
| |||
1776 | 1739 |
| |
1777 | 1740 |
| |
1778 | 1741 |
| |
| 1742 | + | |
| 1743 | + | |
| 1744 | + | |
| 1745 | + | |
| 1746 | + | |
| 1747 | + | |
| 1748 | + | |
| 1749 | + | |
| 1750 | + | |
| 1751 | + | |
| 1752 | + | |
| 1753 | + | |
| 1754 | + | |
| 1755 | + | |
| 1756 | + | |
| 1757 | + | |
| 1758 | + | |
| 1759 | + | |
| 1760 | + | |
| 1761 | + | |
| 1762 | + | |
| 1763 | + | |
| 1764 | + | |
| 1765 | + | |
| 1766 | + | |
| 1767 | + | |
| 1768 | + | |
| 1769 | + | |
| 1770 | + | |
| 1771 | + | |
| 1772 | + | |
| 1773 | + | |
| 1774 | + | |
| 1775 | + | |
| 1776 | + | |
| 1777 | + | |
| 1778 | + | |
| 1779 | + | |
| 1780 | + | |
| 1781 | + | |
| 1782 | + | |
| 1783 | + | |
| 1784 | + | |
| 1785 | + | |
| 1786 | + | |
| 1787 | + | |
| 1788 | + | |
| 1789 | + | |
| 1790 | + | |
| 1791 | + | |
| 1792 | + | |
| 1793 | + | |
| 1794 | + | |
| 1795 | + | |
| 1796 | + | |
| 1797 | + | |
| 1798 | + | |
| 1799 | + | |
| 1800 | + | |
| 1801 | + | |
| 1802 | + | |
| 1803 | + | |
| 1804 | + | |
| 1805 | + | |
| 1806 | + | |
1779 | 1807 |
| |
1780 | 1808 |
| |
1781 | 1809 |
| |
| |||
1824 | 1852 |
| |
1825 | 1853 |
| |
1826 | 1854 |
| |
1827 |
| - | |
| 1855 | + | |
| 1856 | + | |
1828 | 1857 |
| |
1829 | 1858 |
| |
1830 | 1859 |
| |
| |||
1888 | 1917 |
| |
1889 | 1918 |
| |
1890 | 1919 |
| |
1891 |
| - | |
| 1920 | + | |
1892 | 1921 |
| |
1893 | 1922 |
| |
1894 | 1923 |
| |
| |||
1993 | 2022 |
| |
1994 | 2023 |
| |
1995 | 2024 |
| |
1996 |
| - | |
| 2025 | + | |
| 2026 | + | |
1997 | 2027 |
| |
1998 | 2028 |
| |
1999 | 2029 |
| |
| |||
2029 | 2059 |
| |
2030 | 2060 |
| |
2031 | 2061 |
| |
2032 |
| - | |
| 2062 | + | |
2033 | 2063 |
| |
2034 |
| - | |
2035 |
| - | |
2036 |
| - | |
2037 |
| - | |
2038 |
| - | |
2039 |
| - | |
2040 |
| - | |
| 2064 | + | |
| 2065 | + | |
| 2066 | + | |
| 2067 | + | |
| 2068 | + | |
| 2069 | + | |
| 2070 | + | |
2041 | 2071 |
| |
2042 | 2072 |
| |
2043 | 2073 |
| |
|
Lines changed: 2 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1198 | 1198 |
| |
1199 | 1199 |
| |
1200 | 1200 |
| |
1201 |
| - | |
1202 | 1201 |
| |
1203 | 1202 |
| |
1204 |
| - | |
1205 | 1203 |
| |
1206 | 1204 |
| |
1207 | 1205 |
| |
1208 |
| - | |
1209 |
| - | |
1210 |
| - | |
| 1206 | + | |
| 1207 | + | |
1211 | 1208 |
| |
1212 | 1209 |
| |
1213 | 1210 |
| |
|
Lines changed: 2 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
948 | 948 |
| |
949 | 949 |
| |
950 | 950 |
| |
951 |
| - | |
952 | 951 |
| |
953 | 952 |
| |
954 |
| - | |
955 | 953 |
| |
956 | 954 |
| |
957 | 955 |
| |
958 |
| - | |
959 |
| - | |
960 |
| - | |
| 956 | + | |
| 957 | + | |
961 | 958 |
| |
962 | 959 |
| |
963 | 960 |
| |
|
Lines changed: 2 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2388 | 2388 |
| |
2389 | 2389 |
| |
2390 | 2390 |
| |
2391 |
| - | |
2392 | 2391 |
| |
2393 | 2392 |
| |
2394 |
| - | |
2395 | 2393 |
| |
2396 | 2394 |
| |
2397 | 2395 |
| |
2398 |
| - | |
2399 |
| - | |
2400 |
| - | |
| 2396 | + | |
| 2397 | + | |
2401 | 2398 |
| |
2402 | 2399 |
| |
2403 | 2400 |
| |
|
0 commit comments
Comments
(0)