From 1cbe4d0aa375df0371da19ca88d2e0dda2708ea2 Mon Sep 17 00:00:00 2001 From: Sami Imseih Date: Fri, 3 Jan 2025 12:16:37 -0600 Subject: [PATCH 1/1] improve DEBUG1 logging of parallel workers for CREATE INDEX --- src/backend/access/brin/brin.c | 4 ++++ src/backend/access/nbtree/nbtsort.c | 4 ++++ src/backend/catalog/index.c | 5 ++--- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/backend/access/brin/brin.c b/src/backend/access/brin/brin.c index 9a98454757..f587e13135 100644 --- a/src/backend/access/brin/brin.c +++ b/src/backend/access/brin/brin.c @@ -2512,6 +2512,10 @@ _brin_begin_parallel(BrinBuildState *buildstate, Relation heap, Relation index, brinleader->walusage = walusage; brinleader->bufferusage = bufferusage; + ereport(DEBUG1, + (errmsg_internal("launched %d parallel vacuum workers for index vacuuming (planned: %d)", + pcxt->nworkers_launched, pcxt->nworkers_to_launch))); + /* If no workers were successfully launched, back out (do serial build) */ if (pcxt->nworkers_launched == 0) { diff --git a/src/backend/access/nbtree/nbtsort.c b/src/backend/access/nbtree/nbtsort.c index 7aba852db9..b9f39aea73 100644 --- a/src/backend/access/nbtree/nbtsort.c +++ b/src/backend/access/nbtree/nbtsort.c @@ -1582,6 +1582,10 @@ _bt_begin_parallel(BTBuildState *buildstate, bool isconcurrent, int request) btleader->walusage = walusage; btleader->bufferusage = bufferusage; + ereport(DEBUG1, + (errmsg_internal("launched %d parallel vacuum workers for index vacuuming (planned: %d)", + pcxt->nworkers_launched, pcxt->nworkers_to_launch))); + /* If no workers were successfully launched, back out (do serial build) */ if (pcxt->nworkers_launched == 0) { diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c index 221fbb4e28..e7846fd9d4 100644 --- a/src/backend/catalog/index.c +++ b/src/backend/catalog/index.c @@ -3007,10 +3007,9 @@ index_build(Relation heapRelation, RelationGetRelationName(heapRelation)))); else ereport(DEBUG1, - (errmsg_internal("building index \"%s\" on table \"%s\" with request for %d parallel workers", + (errmsg_internal("building index \"%s\" on table \"%s\"", RelationGetRelationName(indexRelation), - RelationGetRelationName(heapRelation), - indexInfo->ii_ParallelWorkers))); + RelationGetRelationName(heapRelation)))); /* * Switch to the table owner's userid, so that any index functions are run -- 2.39.5 (Apple Git-154)