- Notifications
You must be signed in to change notification settings - Fork5
Commite540b97
committed
Fix an oversight in the 8.2 patch that improved mergejoin performance by
inserting a materialize node above an inner-side sort node, when the sort isexpected to spill to disk. (The materialize protects the sort from havingto support mark/restore, allowing it to do its final merge pass on-the-fly.)We neglected to teach cost_mergejoin about that hack, so it was failing toinclude the materialize's costs in the estimated cost of the mergejoin.The materialize's costs are generally going to be pretty negligible incomparison to the sort's, so this is only a small error and probably notworth back-patching; but it's still wrong.In the similar case where a materialize is inserted to protect an inner-sidenode that can't do mark/restore at all, it's still true that the materializeshould not spill to disk, and so we should cost it cheaply rather thanexpensively.Noted while thinking about a question from Tom Raney.1 parent5882958 commite540b97
File tree
3 files changed
+50
-12
lines changed- src/backend/optimizer
- path
- plan
- util
3 files changed
+50
-12
lines changedLines changed: 14 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
54 | 54 |
| |
55 | 55 |
| |
56 | 56 |
| |
57 |
| - | |
| 57 | + | |
58 | 58 |
| |
59 | 59 |
| |
60 | 60 |
| |
| |||
1584 | 1584 |
| |
1585 | 1585 |
| |
1586 | 1586 |
| |
| 1587 | + | |
| 1588 | + | |
| 1589 | + | |
| 1590 | + | |
| 1591 | + | |
| 1592 | + | |
| 1593 | + | |
| 1594 | + | |
| 1595 | + | |
| 1596 | + | |
| 1597 | + | |
| 1598 | + | |
| 1599 | + | |
1587 | 1600 |
| |
1588 | 1601 |
| |
1589 | 1602 |
| |
|
Lines changed: 3 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
10 | 10 |
| |
11 | 11 |
| |
12 | 12 |
| |
13 |
| - | |
| 13 | + | |
14 | 14 |
| |
15 | 15 |
| |
16 | 16 |
| |
| |||
1545 | 1545 |
| |
1546 | 1546 |
| |
1547 | 1547 |
| |
1548 |
| - | |
| 1548 | + | |
| 1549 | + | |
1549 | 1550 |
| |
1550 | 1551 |
| |
1551 | 1552 |
| |
|
Lines changed: 33 additions & 9 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
11 |
| - | |
| 11 | + | |
12 | 12 |
| |
13 | 13 |
| |
14 | 14 |
| |
| |||
1304 | 1304 |
| |
1305 | 1305 |
| |
1306 | 1306 |
| |
1307 |
| - | |
1308 |
| - | |
| 1307 | + | |
1309 | 1308 |
| |
1310 | 1309 |
| |
1311 |
| - | |
1312 |
| - | |
1313 |
| - | |
1314 |
| - | |
| 1310 | + | |
| 1311 | + | |
| 1312 | + | |
| 1313 | + | |
| 1314 | + | |
| 1315 | + | |
| 1316 | + | |
| 1317 | + | |
| 1318 | + | |
| 1319 | + | |
| 1320 | + | |
| 1321 | + | |
1315 | 1322 |
| |
1316 | 1323 |
| |
1317 | 1324 |
| |
1318 |
| - | |
1319 |
| - | |
| 1325 | + | |
| 1326 | + | |
| 1327 | + | |
| 1328 | + | |
| 1329 | + | |
| 1330 | + | |
| 1331 | + | |
| 1332 | + | |
| 1333 | + | |
| 1334 | + | |
| 1335 | + | |
| 1336 | + | |
| 1337 | + | |
| 1338 | + | |
| 1339 | + | |
| 1340 | + | |
| 1341 | + | |
| 1342 | + | |
| 1343 | + | |
1320 | 1344 |
| |
1321 | 1345 |
| |
1322 | 1346 |
| |
|
0 commit comments
Comments
(0)