- Notifications
You must be signed in to change notification settings - Fork28
Commit333ed24
committed
Avoid passing query tlist around separately from root->processed_tlist.
In the dim past, the planner kept the fully-processed version of the querytargetlist (the result of preprocess_targetlist) in grouping_planner'slocal variable "tlist", and only grudgingly passed it to individual otherroutines as needed. Later we discovered a need to still have it availableafter grouping_planner finishes, and invented the root->processed_tlistfield for that purpose, but it wasn't used internally to grouping_planner;the tlist was still being passed around separately in the same places asbefore.Now comes a proposed patch to allow appendrel expansion to add entriesto the processed tlist, well after preprocess_targetlist has finishedits work. To avoid having to pass around the tlist explicitly, it'sproposed to allow appendrel expansion to modify root->processed_tlist.That makes aliasing the tlist with assorted parameters and localvariables really scary. It would accidentally work as long as thetlist is initially nonempty, because then the List header won't movearound, but it's not exactly hard to think of ways for that to break.Aliased values are poor programming practice anyway.Hence, get rid of local variables and parameters that can be identifiedwith root->processed_tlist, in favor of just using that field directly.And adjust comments to match. (Some of the new comments speak as thoughit's already possible for appendrel expansion to modify the tlist; that'snot true yet, but will happen in a later patch.)Discussion:https://postgr.es/m/9d7c5112-cb99-6a47-d3be-cf1ee6862a1d@lab.ntt.co.jp1 parent9938d11 commit333ed24
File tree
5 files changed
+45
-58
lines changed- src
- backend/optimizer/plan
- include
- nodes
- optimizer
5 files changed
+45
-58
lines changedLines changed: 10 additions & 9 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
68 | 68 |
| |
69 | 69 |
| |
70 | 70 |
| |
71 |
| - | |
72 |
| - | |
73 |
| - | |
74 | 71 |
| |
75 | 72 |
| |
76 |
| - | |
| 73 | + | |
77 | 74 |
| |
78 | 75 |
| |
79 | 76 |
| |
| |||
144 | 141 |
| |
145 | 142 |
| |
146 | 143 |
| |
147 |
| - | |
| 144 | + | |
148 | 145 |
| |
149 | 146 |
| |
150 | 147 |
| |
| |||
218 | 215 |
| |
219 | 216 |
| |
220 | 217 |
| |
| 218 | + | |
| 219 | + | |
221 | 220 |
| |
222 | 221 |
| |
223 | 222 |
| |
224 | 223 |
| |
225 |
| - | |
| 224 | + | |
| 225 | + | |
226 | 226 |
| |
227 | 227 |
| |
228 | 228 |
| |
| |||
421 | 421 |
| |
422 | 422 |
| |
423 | 423 |
| |
424 |
| - | |
| 424 | + | |
425 | 425 |
| |
426 | 426 |
| |
427 | 427 |
| |
| |||
442 | 442 |
| |
443 | 443 |
| |
444 | 444 |
| |
445 |
| - | |
| 445 | + | |
446 | 446 |
| |
447 | 447 |
| |
448 | 448 |
| |
| |||
476 | 476 |
| |
477 | 477 |
| |
478 | 478 |
| |
479 |
| - | |
| 479 | + | |
| 480 | + | |
480 | 481 |
| |
481 | 482 |
| |
482 | 483 |
| |
|
Lines changed: 2 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
42 | 42 |
| |
43 | 43 |
| |
44 | 44 |
| |
45 |
| - | |
46 |
| - | |
47 | 45 |
| |
48 | 46 |
| |
49 | 47 |
| |
| |||
54 | 52 |
| |
55 | 53 |
| |
56 | 54 |
| |
57 |
| - | |
| 55 | + | |
58 | 56 |
| |
59 | 57 |
| |
60 | 58 |
| |
| |||
179 | 177 |
| |
180 | 178 |
| |
181 | 179 |
| |
182 |
| - | |
| 180 | + | |
183 | 181 |
| |
184 | 182 |
| |
185 | 183 |
| |
|
Lines changed: 24 additions & 41 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
95 | 95 |
| |
96 | 96 |
| |
97 | 97 |
| |
98 |
| - | |
99 | 98 |
| |
100 | 99 |
| |
101 | 100 |
| |
| |||
182 | 181 |
| |
183 | 182 |
| |
184 | 183 |
| |
185 |
| - | |
186 | 184 |
| |
187 | 185 |
| |
188 | 186 |
| |
189 | 187 |
| |
190 | 188 |
| |
191 | 189 |
| |
192 | 190 |
| |
193 |
| - | |
194 | 191 |
| |
195 | 192 |
| |
196 | 193 |
| |
| |||
1588 | 1585 |
| |
1589 | 1586 |
| |
1590 | 1587 |
| |
1591 |
| - | |
1592 | 1588 |
| |
1593 | 1589 |
| |
1594 | 1590 |
| |
1595 |
| - | |
1596 |
| - | |
| 1591 | + | |
| 1592 | + | |
1597 | 1593 |
| |
1598 | 1594 |
| |
1599 | 1595 |
| |
| |||
1693 | 1689 |
| |
1694 | 1690 |
| |
1695 | 1691 |
| |
1696 |
| - | |
1697 | 1692 |
| |
1698 | 1693 |
| |
1699 | 1694 |
| |
| |||
1746 | 1741 |
| |
1747 | 1742 |
| |
1748 | 1743 |
| |
1749 |
| - | |
1750 |
| - | |
| 1744 | + | |
| 1745 | + | |
1751 | 1746 |
| |
1752 | 1747 |
| |
1753 | 1748 |
| |
1754 | 1749 |
| |
1755 | 1750 |
| |
1756 |
| - | |
1757 |
| - | |
1758 | 1751 |
| |
1759 |
| - | |
1760 |
| - | |
1761 |
| - | |
1762 |
| - | |
| 1752 | + | |
| 1753 | + | |
| 1754 | + | |
1763 | 1755 |
| |
1764 | 1756 |
| |
1765 | 1757 |
| |
| |||
1791 | 1783 |
| |
1792 | 1784 |
| |
1793 | 1785 |
| |
1794 |
| - | |
| 1786 | + | |
1795 | 1787 |
| |
1796 | 1788 |
| |
1797 | 1789 |
| |
| |||
1831 | 1823 |
| |
1832 | 1824 |
| |
1833 | 1825 |
| |
1834 |
| - | |
1835 |
| - | |
1836 |
| - | |
1837 | 1826 |
| |
1838 |
| - | |
1839 |
| - | |
1840 |
| - | |
| 1827 | + | |
| 1828 | + | |
| 1829 | + | |
1841 | 1830 |
| |
1842 |
| - | |
| 1831 | + | |
1843 | 1832 |
| |
1844 |
| - | |
| 1833 | + | |
1845 | 1834 |
| |
1846 | 1835 |
| |
1847 | 1836 |
| |
| |||
1859 | 1848 |
| |
1860 | 1849 |
| |
1861 | 1850 |
| |
1862 |
| - | |
1863 |
| - | |
| 1851 | + | |
| 1852 | + | |
1864 | 1853 |
| |
1865 | 1854 |
| |
1866 | 1855 |
| |
| |||
1873 | 1862 |
| |
1874 | 1863 |
| |
1875 | 1864 |
| |
1876 |
| - | |
| 1865 | + | |
1877 | 1866 |
| |
1878 | 1867 |
| |
1879 | 1868 |
| |
| |||
1888 | 1877 |
| |
1889 | 1878 |
| |
1890 | 1879 |
| |
1891 |
| - | |
| 1880 | + | |
1892 | 1881 |
| |
1893 | 1882 |
| |
1894 | 1883 |
| |
| |||
1908 | 1897 |
| |
1909 | 1898 |
| |
1910 | 1899 |
| |
1911 |
| - | |
1912 | 1900 |
| |
1913 | 1901 |
| |
1914 | 1902 |
| |
| |||
1921 | 1909 |
| |
1922 | 1910 |
| |
1923 | 1911 |
| |
1924 |
| - | |
1925 |
| - | |
| 1912 | + | |
1926 | 1913 |
| |
1927 | 1914 |
| |
1928 | 1915 |
| |
1929 | 1916 |
| |
1930 |
| - | |
| 1917 | + | |
| 1918 | + | |
| 1919 | + | |
1931 | 1920 |
| |
1932 | 1921 |
| |
1933 | 1922 |
| |
1934 |
| - | |
| 1923 | + | |
1935 | 1924 |
| |
1936 | 1925 |
| |
1937 | 1926 |
| |
| |||
2087 | 2076 |
| |
2088 | 2077 |
| |
2089 | 2078 |
| |
2090 |
| - | |
2091 | 2079 |
| |
2092 | 2080 |
| |
2093 | 2081 |
| |
| |||
3455 | 3443 |
| |
3456 | 3444 |
| |
3457 | 3445 |
| |
3458 |
| - | |
| 3446 | + | |
3459 | 3447 |
| |
3460 | 3448 |
| |
3461 | 3449 |
| |
| |||
4401 | 4389 |
| |
4402 | 4390 |
| |
4403 | 4391 |
| |
4404 |
| - | |
4405 | 4392 |
| |
4406 | 4393 |
| |
4407 | 4394 |
| |
| |||
4413 | 4400 |
| |
4414 | 4401 |
| |
4415 | 4402 |
| |
4416 |
| - | |
4417 | 4403 |
| |
4418 | 4404 |
| |
4419 | 4405 |
| |
| |||
4456 | 4442 |
| |
4457 | 4443 |
| |
4458 | 4444 |
| |
4459 |
| - | |
4460 | 4445 |
| |
4461 | 4446 |
| |
4462 | 4447 |
| |
| |||
4490 | 4475 |
| |
4491 | 4476 |
| |
4492 | 4477 |
| |
4493 |
| - | |
4494 | 4478 |
| |
4495 | 4479 |
| |
4496 | 4480 |
| |
| |||
4500 | 4484 |
| |
4501 | 4485 |
| |
4502 | 4486 |
| |
4503 |
| - | |
4504 | 4487 |
| |
4505 | 4488 |
| |
4506 | 4489 |
| |
| |||
4531 | 4514 |
| |
4532 | 4515 |
| |
4533 | 4516 |
| |
4534 |
| - | |
| 4517 | + | |
4535 | 4518 |
| |
4536 | 4519 |
| |
4537 | 4520 |
| |
|
Lines changed: 7 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
307 | 307 |
| |
308 | 308 |
| |
309 | 309 |
| |
310 |
| - | |
311 |
| - | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
312 | 317 |
| |
313 | 318 |
| |
314 | 319 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
27 | 27 |
| |
28 | 28 |
| |
29 | 29 |
| |
30 |
| - | |
| 30 | + | |
31 | 31 |
| |
32 | 32 |
| |
33 | 33 |
| |
34 | 34 |
| |
35 | 35 |
| |
36 |
| - | |
| 36 | + | |
37 | 37 |
| |
38 | 38 |
| |
39 | 39 |
| |
|
0 commit comments
Comments
(0)