Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 48d4a8c

Browse files
author
Amit Kapila
committed
Allocate access strategy in parallel VACUUM workers.
Currently, parallel vacuum workers don't use any buffer access strategy. We can fix it either by propagating the access strategy from a leader or allow each worker to use BAS_VACUUM access strategy type. We don't see much use in propagating this information from leader as both leader and workers are supposed to use the same strategy. We might want to use a different access strategy for leader and workers but that would be a separate optimization not suitable for back-branches. This has been fixed in HEAD as commit f6b8f19. Author: Amit Kapila Reviewed-by: Sawada Masahiko, Bharath Rupireddy Discussion: https://postgr.es/m/CAA4eK1KbmJgRV2W3BbzRnKUSrukN7SbqBBriC4RDB5KBhopkGQ@mail.gmail.com
1 parent be79deb commit 48d4a8c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/backend/access/heap/vacuumlazy.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3510,6 +3510,9 @@ parallel_vacuum_main(dsm_segment *seg, shm_toc *toc)
35103510
vac_open_indexes(onerel, RowExclusiveLock, &nindexes, &indrels);
35113511
Assert(nindexes > 0);
35123512

3513+
/* Each parallel VACUUM worker gets its own access strategy */
3514+
vac_strategy = GetAccessStrategy(BAS_VACUUM);
3515+
35133516
/* Set dead tuple space */
35143517
dead_tuples = (LVDeadTuples *) shm_toc_lookup(toc,
35153518
PARALLEL_VACUUM_KEY_DEAD_TUPLES,
@@ -3564,6 +3567,7 @@ parallel_vacuum_main(dsm_segment *seg, shm_toc *toc)
35643567

35653568
vac_close_indexes(nindexes, indrels, RowExclusiveLock);
35663569
table_close(onerel, ShareUpdateExclusiveLock);
3570+
FreeAccessStrategy(vac_strategy);
35673571
pfree(stats);
35683572
}
35693573

0 commit comments

Comments
 (0)