From 24b27d34f08c6895cc4ed63ea364735c7a888cdc Mon Sep 17 00:00:00 2001 From: osdba Date: Tue, 14 Nov 2023 16:50:07 +0800 Subject: [PATCH] Increase pg_prewarm loading speed --- contrib/pg_prewarm/pg_prewarm.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/contrib/pg_prewarm/pg_prewarm.c b/contrib/pg_prewarm/pg_prewarm.c index 1f4bfb8c0d4..2b7c778df45 100644 --- a/contrib/pg_prewarm/pg_prewarm.c +++ b/contrib/pg_prewarm/pg_prewarm.c @@ -192,7 +192,11 @@ pg_prewarm(PG_FUNCTION_ARGS) Buffer buf; CHECK_FOR_INTERRUPTS(); - buf = ReadBufferExtended(rel, forkNumber, block, RBM_NORMAL, NULL); + //buf = ReadBufferExtended(rel, forkNumber, block, RBM_NORMAL, NULL); + buf = polar_bulk_read_buffer_extended(rel, MAIN_FORKNUM, block, + RBM_NORMAL, NULL, + 64); + ReleaseBuffer(buf); ++blocks_done; }