From fc4d3dc5f2e0fd7ff488b480edf86a07fcb5fe6f Mon Sep 17 00:00:00 2001 From: Lukas Fittl Date: Thu, 26 Nov 2026 09:55:13 -0800 Subject: [PATCH v3 1/4] Don't track table scan progress in parallel BRIN build workers _brin_parallel_scan_and_build() takes a "progress" argument, which the leader passes as true and parallel workers pass as false, but it ignored the argument and always asked table_index_build_scan() to report progress. Progress reporting is wasted effort on workers, since the scan writes it to the worker's own backend entry, which is not shown in pg_stat_progress_create_index and is not copied to the leader. Adjust to match how GIN and nbtree handle it, by passing the argument through to the underlying scan. Oversight in b4375717147, which added parallel index builds for BRIN. Author: Lukas Fittl Reviewed-by: Discussion: https://postgr.es/m/CAP53Pkw3WcVbg61G29AmN=6XkuxGryoWKnhTyC1JmkT08i8qVA@mail.gmail.com --- src/backend/access/brin/brin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/access/brin/brin.c b/src/backend/access/brin/brin.c index 5fc40845c17..643bdc74ec9 100644 --- a/src/backend/access/brin/brin.c +++ b/src/backend/access/brin/brin.c @@ -2856,7 +2856,7 @@ _brin_parallel_scan_and_build(BrinBuildState *state, ParallelTableScanFromBrinShared(brinshared), SO_NONE); - reltuples = table_index_build_scan(heap, index, indexInfo, true, true, + reltuples = table_index_build_scan(heap, index, indexInfo, true, progress, brinbuildCallbackParallel, state, scan); /* insert the last item */ -- 2.47.1