pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Improve the performance of relation deletes during recovery. 7+ messages / 1 participants [nested] [flat]
* pgsql: Improve the performance of relation deletes during recovery. @ 2018-07-04 17:59 Fujii Masao <fujii@postgresql.org> 0 siblings, 0 replies; 7+ messages in thread From: Fujii Masao @ 2018-07-04 17:59 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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()) was called for each file to delete, which led to scan shared_buffers multiple times. Obviously this could cause to increase the WAL replay time very much especially when shared_buffers was huge. To alleviate this situation, this commit changes the recovery so that it also calls smgrdounlinkall() only one time to delete multiple relation files. This is just fix for oversight of commit 279628a0a7, not new feature. So, per discussion on pgsql-hackers, we concluded to backpatch this to all supported versions. Author: Fujii Masao Reviewed-by: Michael Paquier, Andres Freund, Thomas Munro, Kyotaro Horiguchi, Takayuki Tsunakawa Discussion: https://postgr.es/m/CAHGQGwHVQkdfDqtvGVkty+19cQakAydXn1etGND3X0PHbZ3+6w@mail.gmail.com Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/b41669118c00e25376a6c9ac991e0d074990484a Modified Files -------------- src/backend/access/transam/twophase.c | 9 ++------- src/backend/access/transam/xact.c | 25 +++-------------------- src/backend/storage/smgr/md.c | 38 +++++++++++++++++++++++++++++++++++ src/include/storage/smgr.h | 1 + 4 files changed, 44 insertions(+), 29 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Improve the performance of relation deletes during recovery. @ 2018-07-04 18:00 Fujii Masao <fujii@postgresql.org> 0 siblings, 0 replies; 7+ messages in thread From: Fujii Masao @ 2018-07-04 18:00 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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()) was called for each file to delete, which led to scan shared_buffers multiple times. Obviously this could cause to increase the WAL replay time very much especially when shared_buffers was huge. To alleviate this situation, this commit changes the recovery so that it also calls smgrdounlinkall() only one time to delete multiple relation files. This is just fix for oversight of commit 279628a0a7, not new feature. So, per discussion on pgsql-hackers, we concluded to backpatch this to all supported versions. Author: Fujii Masao Reviewed-by: Michael Paquier, Andres Freund, Thomas Munro, Kyotaro Horiguchi, Takayuki Tsunakawa Discussion: https://postgr.es/m/CAHGQGwHVQkdfDqtvGVkty+19cQakAydXn1etGND3X0PHbZ3+6w@mail.gmail.com Branch ------ REL_11_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/9e53171b1057ddb50063a58651aff45f8fc339d7 Modified Files -------------- src/backend/access/transam/twophase.c | 9 ++------- src/backend/access/transam/xact.c | 25 +++-------------------- src/backend/storage/smgr/md.c | 38 +++++++++++++++++++++++++++++++++++ src/include/storage/smgr.h | 1 + 4 files changed, 44 insertions(+), 29 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Improve the performance of relation deletes during recovery. @ 2018-07-04 18:00 Fujii Masao <fujii@postgresql.org> 0 siblings, 0 replies; 7+ messages in thread From: Fujii Masao @ 2018-07-04 18:00 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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()) was called for each file to delete, which led to scan shared_buffers multiple times. Obviously this could cause to increase the WAL replay time very much especially when shared_buffers was huge. To alleviate this situation, this commit changes the recovery so that it also calls smgrdounlinkall() only one time to delete multiple relation files. This is just fix for oversight of commit 279628a0a7, not new feature. So, per discussion on pgsql-hackers, we concluded to backpatch this to all supported versions. Author: Fujii Masao Reviewed-by: Michael Paquier, Andres Freund, Thomas Munro, Kyotaro Horiguchi, Takayuki Tsunakawa Discussion: https://postgr.es/m/CAHGQGwHVQkdfDqtvGVkty+19cQakAydXn1etGND3X0PHbZ3+6w@mail.gmail.com Branch ------ REL_10_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/8463be060d4c4b67b1382607433ea1a3a51002e5 Modified Files -------------- src/backend/access/transam/twophase.c | 9 ++------- src/backend/access/transam/xact.c | 25 +++-------------------- src/backend/storage/smgr/md.c | 38 +++++++++++++++++++++++++++++++++++ src/include/storage/smgr.h | 1 + 4 files changed, 44 insertions(+), 29 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Improve the performance of relation deletes during recovery. @ 2018-07-04 18:00 Fujii Masao <fujii@postgresql.org> 0 siblings, 0 replies; 7+ messages in thread From: Fujii Masao @ 2018-07-04 18:00 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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()) was called for each file to delete, which led to scan shared_buffers multiple times. Obviously this could cause to increase the WAL replay time very much especially when shared_buffers was huge. To alleviate this situation, this commit changes the recovery so that it also calls smgrdounlinkall() only one time to delete multiple relation files. This is just fix for oversight of commit 279628a0a7, not new feature. So, per discussion on pgsql-hackers, we concluded to backpatch this to all supported versions. Author: Fujii Masao Reviewed-by: Michael Paquier, Andres Freund, Thomas Munro, Kyotaro Horiguchi, Takayuki Tsunakawa Discussion: https://postgr.es/m/CAHGQGwHVQkdfDqtvGVkty+19cQakAydXn1etGND3X0PHbZ3+6w@mail.gmail.com Branch ------ REL9_6_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/7da22d866d45d940ba40b77881fbb2be803304a5 Modified Files -------------- src/backend/access/transam/twophase.c | 9 ++------- src/backend/access/transam/xact.c | 25 +++-------------------- src/backend/storage/smgr/md.c | 38 +++++++++++++++++++++++++++++++++++ src/include/storage/smgr.h | 1 + 4 files changed, 44 insertions(+), 29 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Improve the performance of relation deletes during recovery. @ 2018-07-04 18:01 Fujii Masao <fujii@postgresql.org> 0 siblings, 0 replies; 7+ messages in thread From: Fujii Masao @ 2018-07-04 18:01 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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()) was called for each file to delete, which led to scan shared_buffers multiple times. Obviously this could cause to increase the WAL replay time very much especially when shared_buffers was huge. To alleviate this situation, this commit changes the recovery so that it also calls smgrdounlinkall() only one time to delete multiple relation files. This is just fix for oversight of commit 279628a0a7, not new feature. So, per discussion on pgsql-hackers, we concluded to backpatch this to all supported versions. Author: Fujii Masao Reviewed-by: Michael Paquier, Andres Freund, Thomas Munro, Kyotaro Horiguchi, Takayuki Tsunakawa Discussion: https://postgr.es/m/CAHGQGwHVQkdfDqtvGVkty+19cQakAydXn1etGND3X0PHbZ3+6w@mail.gmail.com Branch ------ REL9_5_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/614e0729a814091b3c73f9a02c3470a03b83248a Modified Files -------------- src/backend/access/transam/twophase.c | 9 ++------- src/backend/access/transam/xact.c | 25 +++-------------------- src/backend/storage/smgr/md.c | 38 +++++++++++++++++++++++++++++++++++ src/include/storage/smgr.h | 1 + 4 files changed, 44 insertions(+), 29 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Improve the performance of relation deletes during recovery. @ 2018-07-04 18:01 Fujii Masao <fujii@postgresql.org> 0 siblings, 0 replies; 7+ messages in thread From: Fujii Masao @ 2018-07-04 18:01 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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()) was called for each file to delete, which led to scan shared_buffers multiple times. Obviously this could cause to increase the WAL replay time very much especially when shared_buffers was huge. To alleviate this situation, this commit changes the recovery so that it also calls smgrdounlinkall() only one time to delete multiple relation files. This is just fix for oversight of commit 279628a0a7, not new feature. So, per discussion on pgsql-hackers, we concluded to backpatch this to all supported versions. Author: Fujii Masao Reviewed-by: Michael Paquier, Andres Freund, Thomas Munro, Kyotaro Horiguchi, Takayuki Tsunakawa Discussion: https://postgr.es/m/CAHGQGwHVQkdfDqtvGVkty+19cQakAydXn1etGND3X0PHbZ3+6w@mail.gmail.com Branch ------ REL9_4_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/62c2fe6446801d9a7e8169544666416f5536c2bb Modified Files -------------- src/backend/access/transam/twophase.c | 9 ++------- src/backend/access/transam/xact.c | 25 +++-------------------- src/backend/storage/smgr/md.c | 38 +++++++++++++++++++++++++++++++++++ src/include/storage/smgr.h | 1 + 4 files changed, 44 insertions(+), 29 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Improve the performance of relation deletes during recovery. @ 2018-07-04 18:01 Fujii Masao <fujii@postgresql.org> 0 siblings, 0 replies; 7+ messages in thread From: Fujii Masao @ 2018-07-04 18:01 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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()) was called for each file to delete, which led to scan shared_buffers multiple times. Obviously this could cause to increase the WAL replay time very much especially when shared_buffers was huge. To alleviate this situation, this commit changes the recovery so that it also calls smgrdounlinkall() only one time to delete multiple relation files. This is just fix for oversight of commit 279628a0a7, not new feature. So, per discussion on pgsql-hackers, we concluded to backpatch this to all supported versions. Author: Fujii Masao Reviewed-by: Michael Paquier, Andres Freund, Thomas Munro, Kyotaro Horiguchi, Takayuki Tsunakawa Discussion: https://postgr.es/m/CAHGQGwHVQkdfDqtvGVkty+19cQakAydXn1etGND3X0PHbZ3+6w@mail.gmail.com Branch ------ REL9_3_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/7ffe0127e5f104fe932146c4e6c8fd03c5638df7 Modified Files -------------- src/backend/access/transam/twophase.c | 9 ++------- src/backend/access/transam/xact.c | 25 +++-------------------- src/backend/storage/smgr/md.c | 38 +++++++++++++++++++++++++++++++++++ src/include/storage/smgr.h | 1 + 4 files changed, 44 insertions(+), 29 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
end of thread, other threads:[~2018-07-04 18:01 UTC | newest] Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2018-07-04 17:59 pgsql: Improve the performance of relation deletes during recovery. Fujii Masao <fujii@postgresql.org> 2018-07-04 18:00 pgsql: Improve the performance of relation deletes during recovery. Fujii Masao <fujii@postgresql.org> 2018-07-04 18:00 pgsql: Improve the performance of relation deletes during recovery. Fujii Masao <fujii@postgresql.org> 2018-07-04 18:00 pgsql: Improve the performance of relation deletes during recovery. Fujii Masao <fujii@postgresql.org> 2018-07-04 18:01 pgsql: Improve the performance of relation deletes during recovery. Fujii Masao <fujii@postgresql.org> 2018-07-04 18:01 pgsql: Improve the performance of relation deletes during recovery. Fujii Masao <fujii@postgresql.org> 2018-07-04 18:01 pgsql: Improve the performance of relation deletes during recovery. Fujii Masao <fujii@postgresql.org>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox