Skip to content
Permalink

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/4971~1
Choose a base ref
...
head repository: postgresql-cfbot/postgresql
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: cf/4971
Choose a head ref
  • 9 commits
  • 55 files changed
  • 2 contributors

Commits on Nov 24, 2025

  1. This is https://commitfest.postgresql.org/50/5160/ and https://commit…

    …fest.postgresql.org/patch/5438/ merged in single commit. it is required for stability of stress tests.
    michail-nikolaev authored and Commitfest Bot committed Nov 24, 2025
    Configuration menu
    Copy the full SHA
    75416e0 View commit details
    Browse the repository at this point in the history
  2. Add stress tests for concurrent index builds

    Introduce stress tests for concurrent index operations:
    - test concurrent inserts/updates during CREATE/REINDEX INDEX CONCURRENTLY
    - cover various index types (btree, gin, gist, brin, hash, spgist)
    - test unique and non-unique indexes
    - test with expressions and predicates
    - test both parallel and non-parallel operations
    
    These tests verify the behavior of the following commits.
    michail-nikolaev authored and Commitfest Bot committed Nov 24, 2025
    Configuration menu
    Copy the full SHA
    8e17a64 View commit details
    Browse the repository at this point in the history
  3. Add STIR access method and flags related to auxiliary indexes

    This patch provides infrastructure for following enhancements to concurrent index builds by:
    - ii_Auxiliary in IndexInfo: indicates that an index is an auxiliary index used during concurrent index build
    - validate_index in IndexVacuumInfo: set if index_bulk_delete called during the validation phase of concurrent index build
    - STIR(Short-Term Index Replacement) access method is introduced, intended solely for short-lived, auxiliary usage
    
    STIR functions designed as an ephemeral helper during concurrent index builds, temporarily storing TIDs without providing the full features of a typical access method. As such, it raises warnings or errors when accessed outside its specialized usage path.
    
    Planned to be used in following commits.
    michail-nikolaev authored and Commitfest Bot committed Nov 24, 2025
    Configuration menu
    Copy the full SHA
    d0cbe37 View commit details
    Browse the repository at this point in the history
  4. Add Datum storage support to tuplestore

     Extend tuplestore to store individual Datum values:
    - fixed-length datatypes: store raw bytes without a length header
    - variable-length datatypes: include a length header and padding
    - by-value types: store inline
    
    This support enables usages tuplestore for non-tuple data (TIDs) in the next commit.
    michail-nikolaev authored and Commitfest Bot committed Nov 24, 2025
    Configuration menu
    Copy the full SHA
    7345e31 View commit details
    Browse the repository at this point in the history
  5. Use auxiliary indexes for concurrent index operations

    Replace the second table full scan in concurrent index builds with an auxiliary index approach:
    - create a STIR  auxiliary index with the same predicate (if exists) as in main index
    - use it to track tuples inserted during the first phase
    - merge auxiliary index with main index during validation to catch up new index with any tuples missed during the first phase
    - automatically drop auxiliary when main index is ready
    
    To merge main and auxiliary indexes:
    - index_bulk_delete called for both, TIDs put into tuplesort
    - both tuplesort are being sorted
    - both tuplesort scanned with two pointers looking for the TIDs present in auxiliary index, but absent in main one
    - all such TIDs are put into tuplestore
    - all TIDs in tuplestore are fetched using the stream, tuplestore used in heapam_index_validate_scan_read_stream_next to provide the next page to prefetch
    - if fetched tuple is alive - it is inserted into the main index
    
    This eliminates the need for a second full table scan during validation, improving performance especially for large tables. Affects both CREATE INDEX CONCURRENTLY and REINDEX INDEX CONCURRENTLY operations.
    michail-nikolaev authored and Commitfest Bot committed Nov 24, 2025
    Configuration menu
    Copy the full SHA
    6f4585f View commit details
    Browse the repository at this point in the history
  6. Track and drop auxiliary indexes in DROP/REINDEX

    During concurrent index operations, auxiliary indexes may be left as orphaned objects when errors occur (junk auxiliary indexes).
    
    This patch improves the handling of such auxiliary indexes:
    - add auxiliaryForIndexId parameter to index_create() to track dependencies between main and auxiliary indexes
    - automatically drop auxiliary indexes when the main index is dropped
    - delete junk auxiliary indexes properly during REINDEX operations
    michail-nikolaev authored and Commitfest Bot committed Nov 24, 2025
    Configuration menu
    Copy the full SHA
    e2eb401 View commit details
    Browse the repository at this point in the history
  7. Optimize auxiliary index handling

    Skip unnecessary computations for auxiliary indices by:
    - in the index‐insert path, detect auxiliary indexes and bypass Datum value computation
    - set indexUnchanged=false for auxiliary indices to avoid redundant checks
    
    These optimizations reduce overhead during concurrent index operations.
    michail-nikolaev authored and Commitfest Bot committed Nov 24, 2025
    Configuration menu
    Copy the full SHA
    d85b1bb View commit details
    Browse the repository at this point in the history
  8. Refresh snapshot periodically during index validation

    Enhances validation phase of concurrently built indexes by periodically refreshing snapshots rather than using a single reference snapshot. This addresses issues with xmin propagation during long-running validations.
    
    The validation now takes a fresh snapshot every few pages, allowing the xmin horizon to advance. This restores feature of commit d9d0762, which was reverted in commit e28bb88. New STIR-based approach is not depends on single reference snapshot anymore.
    michail-nikolaev authored and Commitfest Bot committed Nov 24, 2025
    Configuration menu
    Copy the full SHA
    a0082cb View commit details
    Browse the repository at this point in the history
  9. [CF 4971] v27 - [CREATE|RE] INDEX CONCURRENTLY with single heap scan

    This branch was automatically generated by a robot using patches from an
    email thread registered at:
    
    https://commitfest.postgresql.org/patch/4971
    
    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/CADzfLwWrGYGE8=cg+6C57Nypv1Y-1mBv8BVzzPWVJy5EfR6YfQ@mail.gmail.com
    Author(s): Michail Nikolaev, Mihail Nikalayeu
    Commitfest Bot committed Nov 24, 2025
    Configuration menu
    Copy the full SHA
    1c510b5 View commit details
    Browse the repository at this point in the history
Loading