- Notifications
You must be signed in to change notification settings - Fork28
Commit7d872c9
committed
Allow direct lookups of AppendRelInfo by child relid
find_appinfos_by_relids had quite a large overhead when the number ofitems in the append_rel_list was high, as it had to trawl through theappend_rel_list looking for AppendRelInfos belonging to the givenchildrelids. Since there can only be a single AppendRelInfo for eachchild rel, it seems much better to store an array in PlannerInfo whichindexes these by child relid, making the function O(1) rather than O(N).This function was only called once inside the planner, so just replacethat call with a lookup to the new array. find_childrel_appendrelinfois now unused and thus removed.This fixes a planner performance regression new to v11 reported byThomas Reiss.Author: David RowleyReported-by: Thomas ReissReviewed-by: Ashutosh BapatReviewed-by: Álvaro HerreraDiscussion:https://postgr.es/m/94dd7a4b-5e50-0712-911d-2278e055c622@dalibo.com1 parent6ca33a8 commit7d872c9
File tree
6 files changed
+74
-48
lines changed- src
- backend/optimizer
- plan
- prep
- util
- include
- nodes
- optimizer
6 files changed
+74
-48
lines changedLines changed: 6 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
124 | 124 |
| |
125 | 125 |
| |
126 | 126 |
| |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
127 | 133 |
| |
128 | 134 |
| |
129 | 135 |
| |
|
Lines changed: 4 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1163 | 1163 |
| |
1164 | 1164 |
| |
1165 | 1165 |
| |
| 1166 | + | |
1166 | 1167 |
| |
1167 | 1168 |
| |
1168 | 1169 |
| |
| |||
1529 | 1530 |
| |
1530 | 1531 |
| |
1531 | 1532 |
| |
| 1533 | + | |
1532 | 1534 |
| |
1533 | 1535 |
| |
1534 | 1536 |
| |
| |||
1579 | 1581 |
| |
1580 | 1582 |
| |
1581 | 1583 |
| |
| 1584 | + | |
| 1585 | + | |
1582 | 1586 |
| |
1583 | 1587 |
| |
1584 | 1588 |
| |
|
Lines changed: 14 additions & 15 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
166 | 166 |
| |
167 | 167 |
| |
168 | 168 |
| |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
169 | 175 |
| |
170 | 176 |
| |
171 | 177 |
| |
| |||
2617 | 2623 |
| |
2618 | 2624 |
| |
2619 | 2625 |
| |
2620 |
| - | |
2621 | 2626 |
| |
2622 | 2627 |
| |
| 2628 | + | |
2623 | 2629 |
| |
2624 | 2630 |
| |
2625 | 2631 |
| |
2626 | 2632 |
| |
2627 |
| - | |
| 2633 | + | |
| 2634 | + | |
2628 | 2635 |
| |
2629 |
| - | |
| 2636 | + | |
2630 | 2637 |
| |
2631 |
| - | |
2632 |
| - | |
2633 |
| - | |
2634 |
| - | |
| 2638 | + | |
| 2639 | + | |
2635 | 2640 |
| |
2636 |
| - | |
2637 |
| - | |
2638 |
| - | |
2639 |
| - | |
| 2641 | + | |
2640 | 2642 |
| |
2641 |
| - | |
2642 |
| - | |
2643 |
| - | |
2644 |
| - | |
| 2643 | + | |
2645 | 2644 |
|
Lines changed: 39 additions & 31 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
88 | 88 |
| |
89 | 89 |
| |
90 | 90 |
| |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
91 | 128 |
| |
92 | 129 |
| |
93 | 130 |
| |
| |||
1184 | 1221 |
| |
1185 | 1222 |
| |
1186 | 1223 |
| |
1187 |
| - | |
1188 |
| - | |
1189 |
| - | |
1190 |
| - | |
1191 |
| - | |
1192 |
| - | |
1193 |
| - | |
1194 |
| - | |
1195 |
| - | |
1196 |
| - | |
1197 |
| - | |
1198 |
| - | |
1199 |
| - | |
1200 |
| - | |
1201 |
| - | |
1202 |
| - | |
1203 |
| - | |
1204 |
| - | |
1205 |
| - | |
1206 |
| - | |
1207 |
| - | |
1208 |
| - | |
1209 |
| - | |
1210 |
| - | |
1211 |
| - | |
1212 |
| - | |
1213 |
| - | |
1214 |
| - | |
1215 |
| - | |
1216 |
| - | |
1217 | 1224 |
| |
1218 | 1225 |
| |
1219 | 1226 |
| |
| |||
1228 | 1235 |
| |
1229 | 1236 |
| |
1230 | 1237 |
| |
| 1238 | + | |
1231 | 1239 |
| |
1232 | 1240 |
| |
1233 | 1241 |
| |
1234 |
| - | |
| 1242 | + | |
1235 | 1243 |
| |
1236 | 1244 |
| |
1237 | 1245 |
| |
|
Lines changed: 10 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
162 | 162 |
| |
163 | 163 |
| |
164 | 164 |
| |
| 165 | + | |
| 166 | + | |
165 | 167 |
| |
166 | 168 |
| |
167 | 169 |
| |
| |||
201 | 203 |
| |
202 | 204 |
| |
203 | 205 |
| |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
204 | 214 |
| |
205 | 215 |
| |
206 | 216 |
| |
|
Lines changed: 1 addition & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
261 | 261 |
| |
262 | 262 |
| |
263 | 263 |
| |
| 264 | + | |
264 | 265 |
| |
265 | 266 |
| |
266 | 267 |
| |
| |||
278 | 279 |
| |
279 | 280 |
| |
280 | 281 |
| |
281 |
| - | |
282 |
| - | |
283 | 282 |
| |
284 | 283 |
| |
285 | 284 |
| |
|
0 commit comments
Comments
(0)