- Notifications
You must be signed in to change notification settings - Fork5
Commitfa117ee
committed
Allow avoiding tuple copy within tuplesort_gettupleslot().
Add a "copy" argument to make it optional to receive a copy of callertuple that is safe to use following a subsequent manipulating oftuplesort's state. This is a performance optimization. Most existingtuplesort_gettupleslot() callers are made to opt out of copying.Existing callers that happen to rely on the validity of tuple memorybeyond subsequent manipulations of the tuplesort request their owncopy.This brings tuplesort_gettupleslot() in line withtuplestore_gettupleslot(). In the future, a "copy"tuplesort_getdatum() argument may be added, that similarly allowscallers to opt out of receiving their own copy of tuple.In passing, clarify assumptions that callers of other tuplesort fetchroutines may make about tuple memory validity, per gripe from TomLane.Author: Peter GeogheganDiscussion: CAM3SWZQWZZ_N=DmmL7tKy_OUjGH_5mN=N=A6h7kHyyDvEhg2DA@mail.gmail.com1 parentaf8a94d commitfa117ee
File tree
5 files changed
+30
-19
lines changed- src
- backend
- executor
- utils
- adt
- sort
- include/utils
5 files changed
+30
-19
lines changedLines changed: 6 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
666 | 666 |
| |
667 | 667 |
| |
668 | 668 |
| |
| 669 | + | |
| 670 | + | |
| 671 | + | |
669 | 672 |
| |
670 | 673 |
| |
671 | 674 |
| |
| |||
674 | 677 |
| |
675 | 678 |
| |
676 | 679 |
| |
677 |
| - | |
678 |
| - | |
| 680 | + | |
| 681 | + | |
679 | 682 |
| |
680 | 683 |
| |
681 | 684 |
| |
| |||
1409 | 1412 |
| |
1410 | 1413 |
| |
1411 | 1414 |
| |
1412 |
| - | |
| 1415 | + | |
1413 | 1416 |
| |
1414 | 1417 |
| |
1415 | 1418 |
| |
|
Lines changed: 3 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
132 | 132 |
| |
133 | 133 |
| |
134 | 134 |
| |
135 |
| - | |
| 135 | + | |
| 136 | + | |
136 | 137 |
| |
137 | 138 |
| |
138 | 139 |
| |
139 | 140 |
| |
140 |
| - | |
| 141 | + | |
141 | 142 |
| |
142 | 143 |
| |
143 | 144 |
| |
|
Lines changed: 3 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1190 | 1190 |
| |
1191 | 1191 |
| |
1192 | 1192 |
| |
1193 |
| - | |
| 1193 | + | |
1194 | 1194 |
| |
1195 | 1195 |
| |
1196 | 1196 |
| |
| |||
1353 | 1353 |
| |
1354 | 1354 |
| |
1355 | 1355 |
| |
1356 |
| - | |
| 1356 | + | |
| 1357 | + | |
1357 | 1358 |
| |
1358 | 1359 |
| |
1359 | 1360 |
| |
|
Lines changed: 17 additions & 11 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1852 | 1852 |
| |
1853 | 1853 |
| |
1854 | 1854 |
| |
1855 |
| - | |
| 1855 | + | |
| 1856 | + | |
1856 | 1857 |
| |
1857 | 1858 |
| |
1858 | 1859 |
| |
| |||
2101 | 2102 |
| |
2102 | 2103 |
| |
2103 | 2104 |
| |
2104 |
| - | |
2105 |
| - | |
2106 |
| - | |
| 2105 | + | |
| 2106 | + | |
| 2107 | + | |
| 2108 | + | |
| 2109 | + | |
| 2110 | + | |
2107 | 2111 |
| |
2108 | 2112 |
| |
2109 |
| - | |
| 2113 | + | |
2110 | 2114 |
| |
2111 | 2115 |
| |
2112 | 2116 |
| |
| |||
2123 | 2127 |
| |
2124 | 2128 |
| |
2125 | 2129 |
| |
2126 |
| - | |
2127 |
| - | |
| 2130 | + | |
| 2131 | + | |
| 2132 | + | |
| 2133 | + | |
2128 | 2134 |
| |
2129 | 2135 |
| |
2130 | 2136 |
| |
| |||
2137 | 2143 |
| |
2138 | 2144 |
| |
2139 | 2145 |
| |
2140 |
| - | |
2141 |
| - | |
| 2146 | + | |
| 2147 | + | |
2142 | 2148 |
| |
2143 | 2149 |
| |
2144 | 2150 |
| |
| |||
2157 | 2163 |
| |
2158 | 2164 |
| |
2159 | 2165 |
| |
2160 |
| - | |
2161 |
| - | |
| 2166 | + | |
| 2167 | + | |
2162 | 2168 |
| |
2163 | 2169 |
| |
2164 | 2170 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
95 | 95 |
| |
96 | 96 |
| |
97 | 97 |
| |
98 |
| - | |
| 98 | + | |
99 | 99 |
| |
100 | 100 |
| |
101 | 101 |
| |
|
0 commit comments
Comments
(0)