-
Notifications
You must be signed in to change notification settings - Fork 2
Permalink
Choose 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/4351~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/4351
Could not load branches
Nothing to show
Loading
Could not load tags
Nothing to show
{{ refName }}
default
Loading
- 4 commits
- 25 files changed
- 2 contributors
Commits on Apr 28, 2025
-
Allows the index AM to provide items (TIDs and tuples) in batches, which is then used to implement prefetching of heap tuples in index scans (including index-only scans). This is similar to prefetching already done in bitmap scans, and can result in significant speedups. The index AM may implement an optional "amgetbatch" callback, returning a batch of items. The indexam.c code then handles this transparently through the existing "getnext" interface. It is up to the index AM to return only batches that it can handle internally. For example, most of the later patches adding support for batching to relevant index AMs (btree, hash, gist, sp-gist) restrict the batches to a single leaf page. This makes implementation of batching much simpler, with only minimal changes to the index AMs, but it's not a hard requirement. The index AM can produce batches spanning arbitrary number of leaf pages. This is left as a possible future improvement. Most of the batching/prefetching logic happens in indexam.c. This means the executor code can continue to call the interface just like before. The only "violation" happens in index-only scans, which need to check the visibility map both when the prefetching pages (we don't want to prefetch pages that are unnecessary) and later when reading the data. For cached data the visibility map checks can be fairly expensive, so it's desirable to keep and reuse the result of the first check. At the moment, the prefetching does not handle mark/restore plans. This is doable, but requires additional synchronization between the batching and index AM code in the "opposite direction". This patch does not actually add batching to any of the index AMs, it's just the common infrastructure. TODO Add the new index AM callback to sgml docs. Re-introduce the callback to check VM and remember the result. It can happen the first few batches (leaf pages) may be returned from the index, skipping the heap fetches. Which means the read stream does no reads until much later after the first batches are already freed. Because the reads only happen when first reading from the stream. In that case we need to be careful about initializing the stream position because setting it to (0,0) would be wrong as the batch is already gone. So just initialize to readPost, which should be initialized already. Could it happen later, or just on first call? Probably first call only, as the read stream always looks ahead for the block that actually needs reading.
Configuration menu - View commit details
-
Copy full SHA for 7951563 - Browse repository at this point
Copy the full SHA 7951563View commit details -
WIP: batching for nbtree indexes
Adds batching/prefetching for btree indexes. Returns only batches from a single leaf page. Does not support mark/restore yet.
Configuration menu - View commit details
-
Copy full SHA for 11d3f18 - Browse repository at this point
Copy the full SHA 11d3f18View commit details -
Configuration menu - View commit details
-
Copy full SHA for e852dd3 - Browse repository at this point
Copy the full SHA e852dd3View commit details -
[CF 4351] v20250422 - Index Prefetching
This branch was automatically generated by a robot using patches from an email thread registered at: https://commitfest.postgresql.org/patch/4351 The branch will be overwritten each time a new patch version is posted to the thread, and also periodically to check for bitrot caused by changes on the master branch. Patch(es): https://www.postgresql.org/message-id/[email protected] Author(s): Tomas Vondra
Commitfest Bot committedApr 28, 2025 Configuration menu - View commit details
-
Copy full SHA for 0cc38f0 - Browse repository at this point
Copy the full SHA 0cc38f0View 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/4351~1...cf/4351