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/4871~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/4871
Choose a head ref
  • 6 commits
  • 83 files changed
  • 3 contributors

Commits on Aug 11, 2024

  1. Introduce IndexAmRoutine.ammorderbyopfirstcol

    Currently IndexAmRoutine.amcanorderbyop property means that index access method
    supports "column op const" ordering for every indexed column.  Upcoming
    knn-btree supports it only for the first column.  In future we will probably
    need to a callback to check whether particular ordering is supported.  But now
    there are no potential use-cases around.  So, don't overengineer it and leave
    with just boolean property.
    
    Discussion: https://postgr.es/m/ce35e97b-cf34-3f5d-6b99-2c25bae49999%40postgrespro.ru
    Author: Nikita Glukhov
    Reviewed-by: Robert Haas, Tom Lane, Anastasia Lubennikova, Alexander Korotkov
    antamel authored and Commitfest Bot committed Aug 11, 2024
    Configuration menu
    Copy the full SHA
    fe28e82 View commit details
    Browse the repository at this point in the history
  2. Allow ordering by operator in ordered indexes

    Currently the only ordered index access method is btree, which doesn't support
    ordering by operator.  So, optimizer has an assumption that ordered index access
    method can't support ordering by operator.  Upcoming knn-btree is going to
    break this assumption.  This commit prepares optimizer for that.  Now we assume
    following.
    
     * Index scan ordered by operator doesn't support backward scan independently
       on amcanbackward.
     * If index native ordering matches query needs then we don't consider possible
       operator ordering.
    
    Discussion: https://postgr.es/m/ce35e97b-cf34-3f5d-6b99-2c25bae49999%40postgrespro.ru
    Author: Nikita Glukhov
    Reviewed-by: Robert Haas, Tom Lane, Anastasia Lubennikova, Alexander Korotkov
    antamel authored and Commitfest Bot committed Aug 11, 2024
    Configuration menu
    Copy the full SHA
    dec6278 View commit details
    Browse the repository at this point in the history
  3. Extract BTScanState from BTScanOpaqueData

    Currently BTScanOpaqueData holds both information about scan keys and state
    of tree scan.  That is OK as soon as we're going to scan btree just in single
    direction.  Upcoming knn-btree patch provides btree scan in two directions
    simultaneously.  This commit extracts data structure representing tree scan
    state in a single direction into separate BTScanState struct in preparation
    for knn-btree.
    
    Discussion: https://postgr.es/m/ce35e97b-cf34-3f5d-6b99-2c25bae49999%40postgrespro.ru
    Author: Nikita Glukhov
    Reviewed-by: Robert Haas, Tom Lane, Anastasia Lubennikova, Alexander Korotkov
    antamel authored and Commitfest Bot committed Aug 11, 2024
    Configuration menu
    Copy the full SHA
    c7b0013 View commit details
    Browse the repository at this point in the history
  4. Move scalar distance operators from btree_gist to core

    Currently btree_gist is the only way to have knn search for scalar datatypes.
    This is why distance operators for those types are defined inside btree_gist
    as well.  Upcoming knn-btree needs these distance operators to be defined in
    core.  This commit moves them from btree_gist to core.
    
    Assuming that extension shared library should still work with non-upgraded
    extension catalog, we btree_gist still provides wrappers over core functions.
    Extension upgrade scripts switch opclasses to core operators and drops extension
    operators.  Extension upgrade script has to refer @extschema@ to distinguish
    between operators with same name.  Have to mark btree_gist as non-relocatable
    in order to do that.
    
    Catversion is bumped.
    btree_gist extension version is bumped.
    
    Discussion: https://postgr.es/m/ce35e97b-cf34-3f5d-6b99-2c25bae49999%40postgrespro.ru
    Author: Nikita Glukhov
    Reviewed-by: Robert Haas, Tom Lane, Anastasia Lubennikova, Alexander Korotkov
    akorotkov authored and Commitfest Bot committed Aug 11, 2024
    Configuration menu
    Copy the full SHA
    feafce1 View commit details
    Browse the repository at this point in the history
  5. Add knn support to btree indexes

    This commit implements support for knn scans in btree indexes.  When knn search
    is requested, btree index is traversed ascending and descending simultaneously.
    At each step the closest tuple is returned.  Filtering operators can reduce
    knn to regular ordered scan.
    
    Ordering operators are added to opfamilies of scalar datatypes.  No extra
    supporting functions are required: knn-btree algorithm works using comparison
    function and ordering operator itself.
    
    Distance operators are not leakproof, because they throw error on overflow.
    Therefore we relax opr_sanity check for btree ordering operators.  It's OK for
    them to be leaky while comparison function is leakproof.
    
    Catversion is bumped.
    
    Discussion: https://postgr.es/m/ce35e97b-cf34-3f5d-6b99-2c25bae49999%40postgrespro.ru
    Author: Nikita Glukhov
    Reviewed-by: Robert Haas, Tom Lane, Anastasia Lubennikova, Alexander Korotkov
    antamel authored and Commitfest Bot committed Aug 11, 2024
    Configuration menu
    Copy the full SHA
    80d67e4 View commit details
    Browse the repository at this point in the history
  6. [CF 49/4871] KNN-btree

    This commit was automatically generated by a robot at cfbot.cputube.org.
    It is based on patches submitted to the PostgreSQL mailing lists and
    registered in the PostgreSQL Commitfest application.
    
    This branch will be overwritten each time a new patch version is posted to
    the email thread, and also periodically to check for bitrot caused by changes
    on the master branch.
    
    Commitfest entry: https://commitfest.postgresql.org/49/4871
    Patch(es): https://www.postgresql.org/message-id/47adb0b0-6e65-4b40-8d93-20dcecc21395@postgrespro.ru
    Author(s): Nikita Glukhov, Anton Melnikov
    Commitfest Bot committed Aug 11, 2024
    Configuration menu
    Copy the full SHA
    3d2b4e4 View commit details
    Browse the repository at this point in the history
Loading