- Notifications
You must be signed in to change notification settings - Fork28
Commit6d2c8c0
committed
Drop cheap-startup-cost paths during add_path() if we don't need them.
We can detect whether the planner top level is going to care at all aboutcheap startup cost (it will only do so if query_planner's tuple_fractionargument is greater than zero). If it isn't, we might as well discardpaths immediately whose only advantage over others is cheap startup cost.This turns out to get rid of quite a lot of paths in complex queries ---I saw planner runtime reduction of more than a third on one large query.Since add_path isn't currently passed the PlannerInfo "root", the easiestway to tell it whether to do this was to add a bool flag to RelOptInfo.That's a bit redundant, since all relations in a given query level willhave the same setting. But in the future it's possible that we'd refinethe control decision to work on a per-relation basis, so this seems likea good arrangement anyway.Per my suggestion of a few months ago.1 parent4da6439 commit6d2c8c0
File tree
6 files changed
+36
-11
lines changed- src
- backend
- nodes
- optimizer/util
- include/nodes
- test/regress
- expected
- sql
6 files changed
+36
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1733 | 1733 | | |
1734 | 1734 | | |
1735 | 1735 | | |
| 1736 | + | |
1736 | 1737 | | |
1737 | 1738 | | |
1738 | 1739 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
142 | 145 | | |
143 | 146 | | |
144 | 147 | | |
145 | 148 | | |
146 | 149 | | |
147 | 150 | | |
148 | 151 | | |
149 | | - | |
| 152 | + | |
| 153 | + | |
150 | 154 | | |
151 | 155 | | |
152 | 156 | | |
| |||
155 | 159 | | |
156 | 160 | | |
157 | 161 | | |
158 | | - | |
| 162 | + | |
| 163 | + | |
159 | 164 | | |
160 | 165 | | |
161 | 166 | | |
| |||
167 | 172 | | |
168 | 173 | | |
169 | 174 | | |
170 | | - | |
| 175 | + | |
| 176 | + | |
171 | 177 | | |
172 | 178 | | |
173 | 179 | | |
| |||
177 | 183 | | |
178 | 184 | | |
179 | 185 | | |
| 186 | + | |
180 | 187 | | |
181 | 188 | | |
182 | 189 | | |
| |||
360 | 367 | | |
361 | 368 | | |
362 | 369 | | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
363 | 373 | | |
364 | 374 | | |
365 | 375 | | |
| |||
423 | 433 | | |
424 | 434 | | |
425 | 435 | | |
426 | | - | |
| 436 | + | |
| 437 | + | |
427 | 438 | | |
428 | 439 | | |
429 | 440 | | |
| |||
488 | 499 | | |
489 | 500 | | |
490 | 501 | | |
491 | | - | |
492 | | - | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
493 | 506 | | |
494 | 507 | | |
495 | 508 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
| 102 | + | |
| 103 | + | |
102 | 104 | | |
103 | 105 | | |
104 | 106 | | |
| |||
354 | 356 | | |
355 | 357 | | |
356 | 358 | | |
| 359 | + | |
| 360 | + | |
357 | 361 | | |
358 | 362 | | |
359 | 363 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
299 | 299 | | |
300 | 300 | | |
301 | 301 | | |
| 302 | + | |
| 303 | + | |
302 | 304 | | |
303 | 305 | | |
304 | 306 | | |
| |||
405 | 407 | | |
406 | 408 | | |
407 | 409 | | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
408 | 413 | | |
409 | 414 | | |
410 | 415 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3437 | 3437 | | |
3438 | 3438 | | |
3439 | 3439 | | |
| 3440 | + | |
3440 | 3441 | | |
3441 | 3442 | | |
3442 | 3443 | | |
| |||
3446 | 3447 | | |
3447 | 3448 | | |
3448 | 3449 | | |
3449 | | - | |
| 3450 | + | |
3450 | 3451 | | |
3451 | 3452 | | |
3452 | 3453 | | |
3453 | | - | |
3454 | 3454 | | |
3455 | | - | |
3456 | 3455 | | |
3457 | 3456 | | |
3458 | | - | |
3459 | 3457 | | |
| 3458 | + | |
3460 | 3459 | | |
| 3460 | + | |
3461 | 3461 | | |
3462 | 3462 | | |
3463 | | - | |
| 3463 | + | |
| 3464 | + | |
3464 | 3465 | | |
3465 | 3466 | | |
3466 | 3467 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
937 | 937 | | |
938 | 938 | | |
939 | 939 | | |
| 940 | + | |
940 | 941 | | |
941 | 942 | | |
942 | 943 | | |
| |||
0 commit comments
Comments
(0)