- Notifications
You must be signed in to change notification settings - Fork 2
PermalinkChoose a base ref {{ refName }} default Choose a head ref {{ refName }} default
Comparing changes
Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.
Open a pull request
Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: postgresql-cfbot/postgresql
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: cf/5326~1
Could not load branches
Nothing to show
Loading
Could not load tags
Nothing to show
{{ refName }} default Loading
...
head repository: postgresql-cfbot/postgresql
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: cf/5326
Could not load branches
Nothing to show
Loading
Could not load tags
Nothing to show
{{ refName }} default Loading
- 5 commits
- 11 files changed
- 2 contributors
Commits on May 18, 2025
Introduces table AM APIs for parallel table vacuuming.
This commit introduces the following new table AM APIs for parallel table vacuuming: - parallel_vacuum_compute_workers - parallel_vacuum_estimate - parallel_vacuum_initialize - parallel_vacuum_initialize_worker - parallel_vacuum_collect_dead_items While parallel_vacuum_compute_workers is required, other new callbacks are optional. There is no code using these new APIs for now. Upcoming parallel vacuum es utilize these APIs. Reviewed-by: Amit Kapila <[email protected]> Reviewed-by: Hayato Kuroda <[email protected]> Reviewed-by: Peter Smith <[email protected]> Reviewed-by: Tomas Vondra <[email protected]> Reviewed-by: Dilip Kumar <[email protected]> Reviewed-by: Melanie Plageman <[email protected]> Discussion: https://postgr.es/m/CAD21AoAEfCNv-GgaDheDJ+s-p_Lv1H24AiJeNoPGCmZNSwL1YA@mail.gmail.com
Configuration menu - View commit details
Copy full SHA for f9fd390 - Browse repository at this point
Copy the full SHA f9fd390View commit details vacuumparallel.c: Support parallel vacuuming for tables to collect de…
…ad items. Previously, parallel vacuum was available only for index vacuuming and index cleanup, ParallelVacuumState was initialized only when the table has at least two indexes that are eligible for parallel index vacuuming and cleanup. This commit extends vacuumparallel.c to support parallel table vacuuming. parallel_vacuum_init() now initializes ParallelVacuumState to perform parallel heap scan to collect dead items, or paralel index vacuuming/cleanup, or both. During the initialization, it asks the table AM for the number of parallel workers required for parallel table vacuuming. If >0, it enables parallel table vacuuming and calls further table AM APIs such as parallel_vacuum_estimate. For parallel table vacuuming, this commit introduces parallel_vacuum_collect_dead_items_begin() function, which can be used to collect dead items in the table (for example, the first pass over heap table in lazy vacuum for heap tables). Heap table AM disables the parallel heap vacuuming for now, but an upcoming uses it. Reviewed-by: Amit Kapila <[email protected]> Reviewed-by: Hayato Kuroda <[email protected]> Reviewed-by: Peter Smith <[email protected]> Reviewed-by: Tomas Vondra <[email protected]> Reviewed-by: Dilip Kumar <[email protected]> Reviewed-by: Melanie Plageman <[email protected]> Discussion: https://postgr.es/m/CAD21AoAEfCNv-GgaDheDJ+s-p_Lv1H24AiJeNoPGCmZNSwL1YA@mail.gmail.com
Configuration menu - View commit details
Copy full SHA for b8a9f21 - Browse repository at this point
Copy the full SHA b8a9f21View commit details Move lazy heap scan related variables to new struct LVScanData.
This is a pure refactoring for upcoming parallel heap scan, which requires storing relation statistics and relation data such as extant oldest XID/MXID collected during lazy heap scan to a shared memory area. Reviewed-by: Amit Kapila <[email protected]> Reviewed-by: Hayato Kuroda <[email protected]> Reviewed-by: Peter Smith <[email protected]> Reviewed-by: Tomas Vondra <[email protected]> Reviewed-by: Dilip Kumar <[email protected]> Reviewed-by: Melanie Plageman <[email protected]> Discussion: https://postgr.es/m/CAD21AoAEfCNv-GgaDheDJ+s-p_Lv1H24AiJeNoPGCmZNSwL1YA@mail.gmail.com
Configuration menu - View commit details
Copy full SHA for 4ad48d5 - Browse repository at this point
Copy the full SHA 4ad48d5View commit details Support parallelism for collecting dead items during lazy vacuum.
This feature allows the vacuum to leverage multiple CPUs in order to collect dead items (i.e. the first pass over heap table) with parallel workers. The parallel degree for parallel heap vacuuming is determined based on the number of blocks to vacuum unless PARALLEL option of VACUUM command is specified, and further limited by max_parallel_maintenance_workers. For the parallel heap scan to collect dead items, we utilize a parallel block table scan, controlled by ParallelBlockTableScanDesc, in conjunction with the read stream. The workers' parallel scan descriptions are stored in the DSM space, enabling different parallel workers to resume the heap scan (phase 1) after a cycle of heap vacuuming and index vacuuming (phase 2 and 3) from their previous state. However, due to the potential presence of pinned buffers loaded by the read stream's look-ahead mechanism, we cannot abruptly stop phase 1 even when the space of dead_items TIDs exceeds the limit. Therefore, once the space of dead_items TIDs exceeds the limit, we begin processing pages without attempting to retrieve additional blocks by look-ahead mechanism until the read stream is exhausted, even if the the memory limit is surpassed. While this approach may increase the memory usage, it typically doesn't pose a significant problem, as processing a few 10s-100s buffers doesn't substantially increase the size of dead_items TIDs. When the parallel heap scan to collect dead items is enabled, we disable eager scanning. This is because parallel vacuum is available only in the VACUUM command and would not occur frequently, which doesn't align with the purpose of eager scanning. Reviewed-by: Amit Kapila <[email protected]> Reviewed-by: Hayato Kuroda <[email protected]> Reviewed-by: Peter Smith <[email protected]> Reviewed-by: Tomas Vondra <[email protected]> Reviewed-by: Dilip Kumar <[email protected]> Reviewed-by: Melanie Plageman <[email protected]> Reviewed-by: Andres Freund <[email protected]> Discussion: https://postgr.es/m/CAD21AoAEfCNv-GgaDheDJ+s-p_Lv1H24AiJeNoPGCmZNSwL1YA@mail.gmail.com
Configuration menu - View commit details
Copy full SHA for 6216df3 - Browse repository at this point
Copy the full SHA 6216df3View commit details [CF 5326] v16 - Parallel heap vacuum
This branch was automatically generated by a robot using es from an email thread registered at: https://commitfest.postgresql.org//5326 The branch will be overwritten each time a new version is posted to the thread, and also periodically to check for bitrot caused by changes on the master branch. (es): https://www.postgresql.org/message-id/CAD21AoCdxc6jLfk5fc1a5-2DgxFikrjFPa6-A5b8pn27i4yKRg@mail.gmail.com Author(s): Masahiko Sawada
Commitfest Bot committedMay 18, 2025 Configuration menu - View commit details
Copy full SHA for 6cabeff - Browse repository at this point
Copy the full SHA 6cabeffView commit details
Loading
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:git diff cf/5326~1...cf/5326