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/5114~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/5114
Choose a head ref
  • 2 commits
  • 5 files changed
  • 2 contributors

Commits on Mar 9, 2025

  1. Use extended stats for precise estimation of bucket size in hash join

    Recognizing the real-life complexity where columns in the table often have
    functional dependencies, PostgreSQL's estimation of the number of distinct
    values over a set of columns can be underestimated (or much rarely,
    overestimated) when dealing with multi-clause JOIN.  In the case of hash
    join, it can end up with a small number of predicted hash  buckets and, as
    a result, picking non-optimal merge join.
    
    To improve the situation, we introduce one additional stage of bucket size
    estimation - having two or more join clauses estimator lookup for extended
    statistics and use it for multicolumn estimation.  Clauses are grouped into
    lists, each containing expressions referencing the same relation.  The result
    of the multicolumn estimation made over such a list is combined with others
    according to the caller's logic.  Clauses that are not estimated are returned
    to the caller for further estimation.
    
    Discussion: https://postgr.es/m/52257607-57f6-850d-399a-ec33a654457b%40postgrespro.ru
    Author: Andrei Lepikhov <[email protected]>
    Reviewed-by: Andy Fan <[email protected]>
    Reviewed-by: Tomas Vondra <[email protected]>
    Reviewed-by: Alena Rybakina <[email protected]>
    Reviewed-by: Alexander Korotkov <[email protected]>
    akorotkov authored and Commitfest Bot committed Mar 9, 2025
    Configuration menu
    Copy the full SHA
    72c2c97 View commit details
    Browse the repository at this point in the history
  2. [CF 5114] v3 - MergeJoin beats HashJoin in the case of multiple hash …

    …clauses
    
    This branch was automatically generated by a robot using patches from an
    email thread registered at:
    
    https://commitfest.postgresql.org/patch/5114
    
    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/CAPpHfdsTnnya8zCAjzTf8Ytw9=4au3o_8WmVpGK-Zn35fSXcyg@mail.gmail.com
    Author(s): Andrei Lepikhov
    Commitfest Bot committed Mar 9, 2025
    Configuration menu
    Copy the full SHA
    e92b44c View commit details
    Browse the repository at this point in the history
Loading