Commit 9f2ee8f
committed
Re-implement EvalPlanQual processing to improve its performance and eliminate
a lot of strange behaviors that occurred in join cases. We now identify the
"current" row for every joined relation in UPDATE, DELETE, and SELECT FOR
UPDATE/SHARE queries. If an EvalPlanQual recheck is necessary, we jam the
appropriate row into each scan node in the rechecking plan, forcing it to emit
only that one row. The former behavior could rescan the whole of each joined
relation for each recheck, which was terrible for performance, and what's much
worse could result in duplicated output tuples.
Also, the original implementation of EvalPlanQual could not re-use the recheck
execution tree --- it had to go through a full executor init and shutdown for
every row to be tested. To avoid this overhead, I've associated a special
runtime Param with each LockRows or ModifyTable plan node, and arranged to
make every scan node below such a node depend on that Param. Thus, by
signaling a change in that Param, the EPQ machinery can just rescan the
already-built test plan.
This patch also adds a prohibition on set-returning functions in the
targetlist of SELECT FOR UPDATE/SHARE. This is needed to avoid the
duplicate-output-tuple problem. It seems fairly reasonable since the
other restrictions on SELECT FOR UPDATE are meant to ensure that there
is a unique correspondence between source tuples and result tuples,
which an output SRF destroys as much as anything else does.1 parent 76d8883 commit 9f2ee8f
File tree
50 files changed
+1550
-1021
lines changed- src
- backend
- commands
- executor
- nodes
- optimizer
- path
- plan
- prep
- parser
- rewrite
- tcop
- utils/cache
- include
- catalog
- commands
- executor
- nodes
- optimizer
- parser
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
50 files changed
+1550
-1021
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
| 64 | + | |
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| |||
1828 | 1828 | | |
1829 | 1829 | | |
1830 | 1830 | | |
1831 | | - | |
| 1831 | + | |
1832 | 1832 | | |
1833 | 1833 | | |
1834 | 1834 | | |
| |||
1842 | 1842 | | |
1843 | 1843 | | |
1844 | 1844 | | |
1845 | | - | |
| 1845 | + | |
1846 | 1846 | | |
1847 | 1847 | | |
1848 | 1848 | | |
| |||
1964 | 1964 | | |
1965 | 1965 | | |
1966 | 1966 | | |
1967 | | - | |
| 1967 | + | |
1968 | 1968 | | |
1969 | 1969 | | |
1970 | 1970 | | |
| |||
1979 | 1979 | | |
1980 | 1980 | | |
1981 | 1981 | | |
1982 | | - | |
| 1982 | + | |
1983 | 1983 | | |
1984 | 1984 | | |
1985 | 1985 | | |
| |||
2107 | 2107 | | |
2108 | 2108 | | |
2109 | 2109 | | |
2110 | | - | |
| 2110 | + | |
2111 | 2111 | | |
2112 | 2112 | | |
2113 | 2113 | | |
| |||
2125 | 2125 | | |
2126 | 2126 | | |
2127 | 2127 | | |
2128 | | - | |
2129 | | - | |
| 2128 | + | |
| 2129 | + | |
2130 | 2130 | | |
2131 | 2131 | | |
2132 | 2132 | | |
| |||
2153 | 2153 | | |
2154 | 2154 | | |
2155 | 2155 | | |
2156 | | - | |
| 2156 | + | |
2157 | 2157 | | |
2158 | 2158 | | |
2159 | 2159 | | |
2160 | 2160 | | |
2161 | 2161 | | |
| 2162 | + | |
| 2163 | + | |
2162 | 2164 | | |
2163 | | - | |
2164 | 2165 | | |
2165 | 2166 | | |
2166 | 2167 | | |
2167 | 2168 | | |
2168 | 2169 | | |
2169 | 2170 | | |
| 2171 | + | |
| 2172 | + | |
| 2173 | + | |
| 2174 | + | |
| 2175 | + | |
| 2176 | + | |
| 2177 | + | |
2170 | 2178 | | |
2171 | 2179 | | |
2172 | 2180 | | |
2173 | 2181 | | |
2174 | 2182 | | |
2175 | 2183 | | |
2176 | | - | |
| 2184 | + | |
2177 | 2185 | | |
2178 | 2186 | | |
2179 | 2187 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
105 | | - | |
| 105 | + | |
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
105 | 108 | | |
106 | 109 | | |
107 | 110 | | |
| |||
0 commit comments