forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit94cad7a
committed
Optimize generate_orderedappend_paths
In generate_orderedappend_paths(), when match_partition_order_desc wastrue, we would lcons() items to various lists in a loop over each livepartition. When the number of live partitions was large, the lcons()could show up in profiles due to it having to perform memmove() to makeway for the new list item.Here we adjust things so that we just perform the loop over the livepartitions backwards when match_partition_order_desc is true. This allowsus to simplify the logic in the loop. Now, as far as the guts of the loopknows, there's no difference between match_partition_order andmatch_partition_order_desc. We can just set match_partition_order to trueso that we build the correct list of paths for the asc and desc case. Peridea from Andres Freund.Discussion:https://postgr.es/m/20230217002351.nyt4y5tdzg6hugdt@awork3.anarazel.de1 parent6773197 commit94cad7a
1 file changed
+34
-23
lines changedLines changed: 34 additions & 23 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1700 | 1700 |
| |
1701 | 1701 |
| |
1702 | 1702 |
| |
1703 |
| - | |
1704 | 1703 |
| |
1705 | 1704 |
| |
| 1705 | + | |
| 1706 | + | |
| 1707 | + | |
1706 | 1708 |
| |
1707 | 1709 |
| |
1708 | 1710 |
| |
| |||
1723 | 1725 |
| |
1724 | 1726 |
| |
1725 | 1727 |
| |
| 1728 | + | |
| 1729 | + | |
| 1730 | + | |
| 1731 | + | |
| 1732 | + | |
| 1733 | + | |
| 1734 | + | |
| 1735 | + | |
| 1736 | + | |
| 1737 | + | |
| 1738 | + | |
| 1739 | + | |
| 1740 | + | |
| 1741 | + | |
| 1742 | + | |
| 1743 | + | |
| 1744 | + | |
| 1745 | + | |
| 1746 | + | |
| 1747 | + | |
| 1748 | + | |
| 1749 | + | |
| 1750 | + | |
| 1751 | + | |
| 1752 | + | |
| 1753 | + | |
| 1754 | + | |
| 1755 | + | |
1726 | 1756 |
| |
1727 |
| - | |
| 1757 | + | |
1728 | 1758 |
| |
1729 |
| - | |
| 1759 | + | |
1730 | 1760 |
| |
1731 | 1761 |
| |
1732 | 1762 |
| |
| |||
1822 | 1852 |
| |
1823 | 1853 |
| |
1824 | 1854 |
| |
1825 |
| - | |
1826 |
| - | |
1827 |
| - | |
1828 |
| - | |
1829 |
| - | |
1830 |
| - | |
1831 |
| - | |
1832 |
| - | |
1833 |
| - | |
1834 |
| - | |
1835 |
| - | |
1836 |
| - | |
1837 |
| - | |
1838 |
| - | |
1839 |
| - | |
1840 |
| - | |
1841 |
| - | |
1842 |
| - | |
1843 |
| - | |
1844 | 1855 |
| |
1845 | 1856 |
| |
1846 | 1857 |
| |
| |||
1859 | 1870 |
| |
1860 | 1871 |
| |
1861 | 1872 |
| |
1862 |
| - | |
| 1873 | + | |
1863 | 1874 |
| |
1864 | 1875 |
| |
1865 | 1876 |
| |
|
0 commit comments
Comments
(0)