forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitd25ea01
committed
Avoid combinatorial explosion in add_child_rel_equivalences().
If an EquivalenceClass member expression includes variables frommultiple appendrels, then instead of producing one substitutedexpression per child relation as intended, we'd create additionalchild expressions for combinations of children of different appendrels.This happened because the child expressions generated while consideringthe first appendrel were taken as sources during substitution of thesecond appendrel, and so on. The extra expressions are useless, and areharmless unless there are too many of them --- but if you have severalappendrels with a thousand or so members each, it gets bad fast.To fix, consider only original (non-em_is_child) EC members as candidatesto be expanded. This requires the ability to substitute directly from atop parent relation's Vars to those of an indirect descendant relation,but we already have that in adjust_appendrel_attrs_multilevel().Per bug #15847 from Feike Steenbergen. This is a longstanding misbehavior,but it's only worth worrying about when there are more appendrel childrenthan we've historically considered wise to use. So I'm not going to takethe risk of back-patching this.Discussion:https://postgr.es/m/15847-ea3734094bf8ae61@postgresql.org1 parentde87a08 commitd25ea01
1 file changed
+36
-13
lines changedLines changed: 36 additions & 13 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2135 | 2135 |
| |
2136 | 2136 |
| |
2137 | 2137 |
| |
2138 |
| - | |
2139 |
| - | |
| 2138 | + | |
| 2139 | + | |
2140 | 2140 |
| |
2141 |
| - | |
2142 |
| - | |
| 2141 | + | |
2143 | 2142 |
| |
2144 | 2143 |
| |
2145 | 2144 |
| |
| |||
2149 | 2148 |
| |
2150 | 2149 |
| |
2151 | 2150 |
| |
2152 |
| - | |
2153 |
| - | |
| 2151 | + | |
| 2152 | + | |
| 2153 | + | |
| 2154 | + | |
| 2155 | + | |
| 2156 | + | |
| 2157 | + | |
| 2158 | + | |
| 2159 | + | |
| 2160 | + | |
| 2161 | + | |
| 2162 | + | |
2154 | 2163 |
| |
2155 | 2164 |
| |
2156 | 2165 |
| |
2157 | 2166 |
| |
2158 | 2167 |
| |
2159 | 2168 |
| |
2160 |
| - | |
2161 |
| - | |
2162 |
| - | |
2163 |
| - | |
| 2169 | + | |
| 2170 | + | |
| 2171 | + | |
| 2172 | + | |
| 2173 | + | |
| 2174 | + | |
| 2175 | + | |
| 2176 | + | |
| 2177 | + | |
| 2178 | + | |
| 2179 | + | |
| 2180 | + | |
| 2181 | + | |
| 2182 | + | |
| 2183 | + | |
| 2184 | + | |
| 2185 | + | |
2164 | 2186 |
| |
2165 | 2187 |
| |
2166 | 2188 |
| |
| |||
2169 | 2191 |
| |
2170 | 2192 |
| |
2171 | 2193 |
| |
2172 |
| - | |
| 2194 | + | |
2173 | 2195 |
| |
2174 | 2196 |
| |
2175 | 2197 |
| |
2176 | 2198 |
| |
2177 | 2199 |
| |
2178 | 2200 |
| |
2179 | 2201 |
| |
2180 |
| - | |
| 2202 | + | |
| 2203 | + | |
2181 | 2204 |
| |
2182 | 2205 |
| |
2183 |
| - | |
| 2206 | + | |
2184 | 2207 |
| |
2185 | 2208 |
| |
2186 | 2209 |
| |
|
0 commit comments
Comments
(0)