mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-10-04 18:26:53 +02:00
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 f6b8f19a08
.
Author: Amit Kapila
Reviewed-by: Sawada Masahiko, Bharath Rupireddy
Discussion: https://postgr.es/m/CAA4eK1KbmJgRV2W3BbzRnKUSrukN7SbqBBriC4RDB5KBhopkGQ@mail.gmail.com
This commit is contained in:
parent
be79debd96
commit
48d4a8c88b
@ -3510,6 +3510,9 @@ parallel_vacuum_main(dsm_segment *seg, shm_toc *toc)
|
||||
vac_open_indexes(onerel, RowExclusiveLock, &nindexes, &indrels);
|
||||
Assert(nindexes > 0);
|
||||
|
||||
/* Each parallel VACUUM worker gets its own access strategy */
|
||||
vac_strategy = GetAccessStrategy(BAS_VACUUM);
|
||||
|
||||
/* Set dead tuple space */
|
||||
dead_tuples = (LVDeadTuples *) shm_toc_lookup(toc,
|
||||
PARALLEL_VACUUM_KEY_DEAD_TUPLES,
|
||||
@ -3564,6 +3567,7 @@ parallel_vacuum_main(dsm_segment *seg, shm_toc *toc)
|
||||
|
||||
vac_close_indexes(nindexes, indrels, RowExclusiveLock);
|
||||
table_close(onerel, ShareUpdateExclusiveLock);
|
||||
FreeAccessStrategy(vac_strategy);
|
||||
pfree(stats);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user