Refactor some repetitive SLRU code
Álvaro Herrera <alvherre@kurilemu.de>
Refactor some repetitive SLRU code Functions to bootstrap and zero pages in various SLRU callers were fairly duplicative. We can slash almost two hundred lines with a couple of simple helpers: - SimpleLruZeroAndWritePage: Does the equivalent of SimpleLruZeroPage followed by flushing the page to disk - XLogSimpleInsertInt64: Does a XLogBeginInsert followed by XLogInsert of a trivial record whose data is just an int64. Author: Evgeny Voropaev <evgeny.voropaev@tantorlabs.com> Reviewed by: Álvaro Herrera <alvherre@kurilemu.de> Reviewed by: Andrey Borodin <x4mmm@yandex-team.ru> Reviewed by: Aleksander Alekseev <aleksander@timescale.com> Discussion: https://www.postgresql.org/message-id/flat/97820ce8-a1cd-407f-a02b-47368fadb14b%40tantorlabs.com
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/access/transam/clog.c | modified | +6 −61 |
| src/backend/access/transam/commit_ts.c | modified | +8 −58 |
| src/backend/access/transam/multixact.c | modified | +14 −106 |
| src/backend/access/transam/slru.c | modified | +25 −0 |
| src/backend/access/transam/subtrans.c | modified | +4 −30 |
| src/backend/access/transam/xloginsert.c | modified | +12 −0 |
| src/include/access/slru.h | modified | +1 −0 |
| src/include/access/xloginsert.h | modified | +1 −0 |