Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
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/5738~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/5738
Choose a head ref
  • 2 commits
  • 13 files changed
  • 2 contributors

Commits on May 22, 2025

  1. Improve hash join's handling of tuples with null join keys.

    In a plain join, we can just summarily discard an input tuple
    with null join key(s), since it cannot match anything from
    the other side of the join (assuming a strict join operator).
    However, if the tuple comes from the outer side of an outer join
    then we have to emit it with null-extension of the other side.
    
    Up to now, hash joins did that by inserting the tuple into the hash
    table as though it were a normal tuple.  This is unnecessarily
    inefficient though, since the required processing is far simpler than
    for a potentially-matchable tuple.  Worse, if there are a lot of such
    tuples they will bloat the hash bucket they go into, possibly causing
    useless repeated attempts to split that bucket or increase the number
    of batches.  We have a report of a large join vainly creating many
    thousands of batches when faced with such input.
    
    This patch improves the situation by keeping such tuples out of the
    hash table altogether, instead pushing them into a separate tuplestore
    from which we return them later.  (One might consider trying to return
    them immediately; but that would require substantial refactoring, and
    it doesn't work anyway for the case where we rescan an unmodified hash
    table.)  This works even in parallel hash joins, because whichever
    worker reads a null-keyed tuple can just return it; there's no need
    for consultation with other workers.  Thus the tuplestores are local
    storage even in a parallel join.
    tglsfdc authored and Commitfest Bot committed May 22, 2025
    Configuration menu
    Copy the full SHA
    90b1271 View commit details
    Browse the repository at this point in the history
  2. [CF 5738] v1 - Improve hash join's handling of tuples with null join …

    …keys
    
    This branch was automatically generated by a robot using patches from an
    email thread registered at:
    
    https://commitfest.postgresql.org/patch/5738
    
    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/3061845.1746486714@sss.pgh.pa.us
    Author(s): Tom Lane
    Commitfest Bot committed May 22, 2025
    Configuration menu
    Copy the full SHA
    c18a464 View commit details
    Browse the repository at this point in the history
Loading