forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit7da22d8
committed
Improve the performance of relation deletes during recovery.
When multiple relations are deleted at the same transaction,the files of those relations are deleted by one call to smgrdounlinkall(),which leads to scan whole shared_buffers only one time. OTOH,previously, during recovery, smgrdounlink() (not smgrdounlinkall()) wascalled for each file to delete, which led to scan shared_buffersmultiple times. Obviously this could cause to increase the WAL replaytime very much especially when shared_buffers was huge.To alleviate this situation, this commit changes the recovery so thatit also calls smgrdounlinkall() only one time to delete multiplerelation files.This is just fix for oversight of commit279628a, not new feature.So, per discussion on pgsql-hackers, we concluded to backpatch thisto all supported versions.Author: Fujii MasaoReviewed-by: Michael Paquier, Andres Freund, Thomas Munro, Kyotaro Horiguchi, Takayuki TsunakawaDiscussion:https://postgr.es/m/CAHGQGwHVQkdfDqtvGVkty+19cQakAydXn1etGND3X0PHbZ3+6w@mail.gmail.com1 parentd7e5805 commit7da22d8
File tree
4 files changed
+44
-29
lines changed- src
- backend
- access/transam
- storage/smgr
- include/storage
4 files changed
+44
-29
lines changedLines changed: 2 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1346 | 1346 |
| |
1347 | 1347 |
| |
1348 | 1348 |
| |
1349 |
| - | |
1350 | 1349 |
| |
1351 | 1350 |
| |
1352 | 1351 |
| |
| |||
1438 | 1437 |
| |
1439 | 1438 |
| |
1440 | 1439 |
| |
1441 |
| - | |
1442 |
| - | |
1443 |
| - | |
1444 | 1440 |
| |
1445 |
| - | |
1446 |
| - | |
1447 |
| - | |
| 1441 | + | |
| 1442 | + | |
1448 | 1443 |
| |
1449 | 1444 |
| |
1450 | 1445 |
| |
|
Lines changed: 3 additions & 22 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
5349 | 5349 |
| |
5350 | 5350 |
| |
5351 | 5351 |
| |
5352 |
| - | |
5353 | 5352 |
| |
5354 | 5353 |
| |
5355 | 5354 |
| |
| |||
5467 | 5466 |
| |
5468 | 5467 |
| |
5469 | 5468 |
| |
5470 |
| - | |
5471 |
| - | |
5472 |
| - | |
5473 |
| - | |
5474 |
| - | |
5475 |
| - | |
5476 |
| - | |
5477 |
| - | |
5478 |
| - | |
5479 |
| - | |
| 5469 | + | |
| 5470 | + | |
5480 | 5471 |
| |
5481 | 5472 |
| |
5482 | 5473 |
| |
| |||
5515 | 5506 |
| |
5516 | 5507 |
| |
5517 | 5508 |
| |
5518 |
| - | |
5519 | 5509 |
| |
5520 | 5510 |
| |
5521 | 5511 |
| |
| |||
5577 | 5567 |
| |
5578 | 5568 |
| |
5579 | 5569 |
| |
5580 |
| - | |
5581 |
| - | |
5582 |
| - | |
5583 |
| - | |
5584 |
| - | |
5585 |
| - | |
5586 |
| - | |
5587 |
| - | |
5588 |
| - | |
5589 |
| - | |
| 5570 | + | |
5590 | 5571 |
| |
5591 | 5572 |
| |
5592 | 5573 |
| |
|
Lines changed: 38 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
26 | 26 |
| |
27 | 27 |
| |
28 | 28 |
| |
| 29 | + | |
29 | 30 |
| |
30 | 31 |
| |
31 | 32 |
| |
| |||
1701 | 1702 |
| |
1702 | 1703 |
| |
1703 | 1704 |
| |
| 1705 | + | |
| 1706 | + | |
| 1707 | + | |
| 1708 | + | |
| 1709 | + | |
| 1710 | + | |
| 1711 | + | |
| 1712 | + | |
| 1713 | + | |
| 1714 | + | |
| 1715 | + | |
| 1716 | + | |
| 1717 | + | |
| 1718 | + | |
| 1719 | + | |
| 1720 | + | |
| 1721 | + | |
| 1722 | + | |
| 1723 | + | |
| 1724 | + | |
| 1725 | + | |
| 1726 | + | |
| 1727 | + | |
| 1728 | + | |
| 1729 | + | |
| 1730 | + | |
| 1731 | + | |
| 1732 | + | |
| 1733 | + | |
| 1734 | + | |
| 1735 | + | |
| 1736 | + | |
| 1737 | + | |
| 1738 | + | |
| 1739 | + | |
| 1740 | + | |
| 1741 | + | |
1704 | 1742 |
| |
1705 | 1743 |
| |
1706 | 1744 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
139 | 139 |
| |
140 | 140 |
| |
141 | 141 |
| |
| 142 | + | |
142 | 143 |
| |
143 | 144 |
| |
144 | 145 |
| |
|
0 commit comments
Comments
(0)