From ba8ad971775d9f3836341f941026b3fb094b3f14 Mon Sep 17 00:00:00 2001 From: jcoleman Date: Wed, 4 Oct 2023 09:43:32 -0400 Subject: [PATCH v2 4/6] log when pruning (2) --- src/backend/access/heap/hio.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/backend/access/heap/hio.c b/src/backend/access/heap/hio.c index 501747063a..e9441123eb 100644 --- a/src/backend/access/heap/hio.c +++ b/src/backend/access/heap/hio.c @@ -704,6 +704,8 @@ loop: if (targetFreeSpace <= pageFreeSpace) { /* use this page as future insert target, too */ + if (relation->rd_id > 16384) + elog(WARNING, "page has free space"); RelationSetTargetBlock(relation, targetBlock); return buffer; } @@ -713,6 +715,8 @@ loop: * Opportunistically prune and see if that frees up enough space to * avoid needing to build a new page. */ + if (relation->rd_id > 16384) + elog(WARNING, "calling heap_page_prune_opt"); heap_page_prune_opt(relation, buffer, true); /* @@ -726,8 +730,20 @@ loop: { /* use this page as future insert target, too */ RelationSetTargetBlock(relation, targetBlock); + if (relation->rd_id > 16384) + elog(WARNING, "heap_page_prune_opt found enough space"); return buffer; } + else + { + if (relation->rd_id > 16384) + elog(WARNING, "heap_page_prune_opt did not find enough space"); + } + } + else + { + if (relation->rd_id > 16384) + elog(WARNING, "heap_page_prune_opt did not unset PD_PAGE_FULL"); } } -- 2.39.3 (Apple Git-145)