forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitc6e4133
committed
Postpone calculating total_table_pages until after pruning/exclusion.
The planner doesn't make any use of root->total_table_pages until itestimates costs of indexscans, so we don't need to compute it asearly as that's currently done. By doing the calculation betweenset_base_rel_sizes and set_base_rel_pathlists, we can omit relationsthat get removed from the query by partition pruning or constraintexclusion, which seems like a more accurate basis for costing.(Historical note: I think at the time this code was written, therewas not a separation between the "set sizes" and "set pathlists"steps, so that this approach would have been impossible at the time.But now that we have that separation, this is clearly the better wayto do things.)David Rowley, reviewed by Edmund HornerDiscussion:https://postgr.es/m/CAKJS1f-NG1mRM0VOtkAG7=ZLQWihoqees9R4ki3CKBB0-fRfCA@mail.gmail.com1 parent77366d9 commitc6e4133
File tree
4 files changed
+49
-39
lines changed- src
- backend/optimizer
- path
- plan
- util
- include/nodes
4 files changed
+49
-39
lines changedLines changed: 43 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
147 | 147 |
| |
148 | 148 |
| |
149 | 149 |
| |
| 150 | + | |
150 | 151 |
| |
151 | 152 |
| |
152 | 153 |
| |
| |||
173 | 174 |
| |
174 | 175 |
| |
175 | 176 |
| |
176 |
| - | |
177 |
| - | |
| 177 | + | |
178 | 178 |
| |
179 | 179 |
| |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
180 | 216 |
| |
181 | 217 |
| |
182 | 218 |
| |
| |||
1271 | 1307 |
| |
1272 | 1308 |
| |
1273 | 1309 |
| |
| 1310 | + | |
| 1311 | + | |
| 1312 | + | |
| 1313 | + | |
| 1314 | + | |
1274 | 1315 |
| |
1275 | 1316 |
| |
1276 | 1317 |
| |
|
Lines changed: 0 additions & 30 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
57 | 57 |
| |
58 | 58 |
| |
59 | 59 |
| |
60 |
| - | |
61 |
| - | |
62 | 60 |
| |
63 | 61 |
| |
64 | 62 |
| |
| |||
231 | 229 |
| |
232 | 230 |
| |
233 | 231 |
| |
234 |
| - | |
235 |
| - | |
236 |
| - | |
237 |
| - | |
238 |
| - | |
239 |
| - | |
240 |
| - | |
241 |
| - | |
242 |
| - | |
243 |
| - | |
244 |
| - | |
245 |
| - | |
246 |
| - | |
247 |
| - | |
248 |
| - | |
249 |
| - | |
250 |
| - | |
251 |
| - | |
252 |
| - | |
253 |
| - | |
254 |
| - | |
255 |
| - | |
256 |
| - | |
257 |
| - | |
258 |
| - | |
259 |
| - | |
260 |
| - | |
261 |
| - | |
262 | 232 |
| |
263 | 233 |
| |
264 | 234 |
| |
|
Lines changed: 2 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
138 | 138 |
| |
139 | 139 |
| |
140 | 140 |
| |
141 |
| - | |
142 |
| - | |
143 |
| - | |
| 141 | + | |
| 142 | + | |
144 | 143 |
| |
145 | 144 |
| |
146 | 145 |
| |
|
Lines changed: 4 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
310 | 310 |
| |
311 | 311 |
| |
312 | 312 |
| |
313 |
| - | |
| 313 | + | |
| 314 | + | |
314 | 315 |
| |
315 | 316 |
| |
316 | 317 |
| |
| |||
687 | 688 |
| |
688 | 689 |
| |
689 | 690 |
| |
690 |
| - | |
691 |
| - | |
692 |
| - | |
| 691 | + | |
| 692 | + | |
693 | 693 |
| |
694 | 694 |
| |
695 | 695 |
| |
|
0 commit comments
Comments
(0)