Skip to content

Conversation

@MMeent
Copy link
Contributor

@MMeent MMeent commented Nov 23, 2022

Prefetch the pages in index vacuum's sequential scans.

This is implemented most efficiently in NBTREE, GIST and SP-GIST due to their effectively sequential vacuum scans with minimal backtracking.

HASH indexes benefit from prefetching as well, as each bucket can be prefetched. The existence of overflow pages makes this more difficult than we'd want, though...

BRIN does not implement a 2nd phase of vacuum, so we do not need to prefetch pages.

GIN cleans up its indexes in a non-seqscan fashion: it scans the 2 btrees from left to right, so prefetching would be very non-trivial to implement. Any prefetching would necessitate significant code changes that I'm not yet comfortable with.

@MMeent MMeent changed the title PG15: Prefetch cleanup: index vacuum prefetching PG15: Prefetch cleanup: index bulkdelete prefetching Nov 23, 2022
- Prefetch the pages in index vacuum's sequential scans
   Implemented in NBTREE, GIST and SP-GIST.
   BRIN does not have a 2nd phase of vacuum, and both GIN and HASH clean up
   their indexes in a non-seqscan fashion: GIN scans the btree from left to
   right, and HASH only scans the initial buckets sequentially.
@MMeent MMeent force-pushed the v15/vacuum-seqscan-prefetches branch from 6a24d50 to 1b38414 Compare November 23, 2022 15:57
@MMeent MMeent merged commit c603b95 into REL_15_STABLE_neon Dec 5, 2022
@MMeent MMeent deleted the v15/vacuum-seqscan-prefetches branch December 5, 2022 15:19
MMeent added a commit that referenced this pull request Feb 10, 2023
- Prefetch the pages in index vacuum's sequential scans
   Implemented in NBTREE, GIST and SP-GIST.
   BRIN does not have a 2nd phase of vacuum, and both GIN and HASH clean up
   their indexes in a non-seqscan fashion: GIN scans the btree from left to
   right, and HASH only scans the initial buckets sequentially.
MMeent added a commit that referenced this pull request May 11, 2023
- Prefetch the pages in index vacuum's sequential scans
   Implemented in NBTREE, GIST and SP-GIST.
   BRIN does not have a 2nd phase of vacuum, and both GIN and HASH clean up
   their indexes in a non-seqscan fashion: GIN scans the btree from left to
   right, and HASH only scans the initial buckets sequentially.
tristan957 pushed a commit that referenced this pull request Aug 10, 2023
- Prefetch the pages in index vacuum's sequential scans
   Implemented in NBTREE, GIST and SP-GIST.
   BRIN does not have a 2nd phase of vacuum, and both GIN and HASH clean up
   their indexes in a non-seqscan fashion: GIN scans the btree from left to
   right, and HASH only scans the initial buckets sequentially.
tristan957 pushed a commit that referenced this pull request Nov 8, 2023
- Prefetch the pages in index vacuum's sequential scans
   Implemented in NBTREE, GIST and SP-GIST.
   BRIN does not have a 2nd phase of vacuum, and both GIN and HASH clean up
   their indexes in a non-seqscan fashion: GIN scans the btree from left to
   right, and HASH only scans the initial buckets sequentially.
tristan957 pushed a commit that referenced this pull request Nov 8, 2023
- Prefetch the pages in index vacuum's sequential scans
   Implemented in NBTREE, GIST and SP-GIST.
   BRIN does not have a 2nd phase of vacuum, and both GIN and HASH clean up
   their indexes in a non-seqscan fashion: GIN scans the btree from left to
   right, and HASH only scans the initial buckets sequentially.
tristan957 pushed a commit that referenced this pull request Nov 8, 2023
- Prefetch the pages in index vacuum's sequential scans
   Implemented in NBTREE, GIST and SP-GIST.
   BRIN does not have a 2nd phase of vacuum, and both GIN and HASH clean up
   their indexes in a non-seqscan fashion: GIN scans the btree from left to
   right, and HASH only scans the initial buckets sequentially.
tristan957 pushed a commit that referenced this pull request Feb 5, 2024
- Prefetch the pages in index vacuum's sequential scans
   Implemented in NBTREE, GIST and SP-GIST.
   BRIN does not have a 2nd phase of vacuum, and both GIN and HASH clean up
   their indexes in a non-seqscan fashion: GIN scans the btree from left to
   right, and HASH only scans the initial buckets sequentially.
tristan957 pushed a commit that referenced this pull request Feb 5, 2024
- Prefetch the pages in index vacuum's sequential scans
   Implemented in NBTREE, GIST and SP-GIST.
   BRIN does not have a 2nd phase of vacuum, and both GIN and HASH clean up
   their indexes in a non-seqscan fashion: GIN scans the btree from left to
   right, and HASH only scans the initial buckets sequentially.
tristan957 pushed a commit that referenced this pull request Feb 6, 2024
- Prefetch the pages in index vacuum's sequential scans
   Implemented in NBTREE, GIST and SP-GIST.
   BRIN does not have a 2nd phase of vacuum, and both GIN and HASH clean up
   their indexes in a non-seqscan fashion: GIN scans the btree from left to
   right, and HASH only scans the initial buckets sequentially.
tristan957 pushed a commit that referenced this pull request May 10, 2024
- Prefetch the pages in index vacuum's sequential scans
   Implemented in NBTREE, GIST and SP-GIST.
   BRIN does not have a 2nd phase of vacuum, and both GIN and HASH clean up
   their indexes in a non-seqscan fashion: GIN scans the btree from left to
   right, and HASH only scans the initial buckets sequentially.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants