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

Commits on Mar 4, 2025

  1. Show index search count in EXPLAIN ANALYZE.

    Expose the count of index searches/index descents in EXPLAIN ANALYZE's
    output for index scan nodes.  This information is particularly useful
    with scans that use ScalarArrayOp quals, where the number of index scans
    isn't predictable in advance (at least not with optimizations like the
    one added to nbtree by Postgres 17 commit 5bf748b).  It will also be
    useful when EXPLAIN ANALYZE shows details of an nbtree index scan that
    uses skip scan optimizations set to be introduced by an upcoming patch.
    
    The instrumentation works by teaching index AMs to increment a new
    nsearches counter whenever a new index search begins.  The counter is
    incremented at exactly the same point that index AMs must already
    increment the index's pg_stat_*_indexes.idx_scan counter (since we're
    counting exactly the same event, though at a finer granularity).
    
    There was much debate on the best place to store the new counter.  We
    settled on storing it in the index scan descriptor (IndexScanDescData).
    This approach is unique among all the different approaches used to track
    query execution costs, but the requirements seem to leave us with no
    better alternative.  The requirements are themselves unique (at least
    right now): we must track the number of searches at the scan granularity
    (at the level of the scan, not the level of the system/relation), from
    within each index AM's amgettuple/amgetbitmap routine (since it isn't
    possible to track it from the executor proper).
    
    Author: Peter Geoghegan <pg@bowt.ie>
    Reviewed-By: Tomas Vondra <tomas@vondra.me>
    Reviewed-By: Robert Haas <robertmhaas@gmail.com>
    Reviewed-By: Masahiro Ikeda <ikedamsh@oss.nttdata.com>
    Discussion: https://postgr.es/m/CAH2-Wz=PKR6rB7qbx+Vnd7eqeB5VTcrW=iJvAsTsKbdG+kW_UA@mail.gmail.com
    Discussion: https://postgr.es/m/CAH2-WzkRqvaqR2CTNqTZP0z6FuL4-3ED6eQB0yx38XBNj1v-4Q@mail.gmail.com
    petergeoghegan authored and Commitfest Bot committed Mar 4, 2025
    Copy the full SHA
    c26e7dd View commit details
  2. [CF 5183] Showing primitive index scan count in EXPLAIN ANALYZE (for …

    …skip scan and SAOP scans)
    
    This branch was automatically generated by a robot using patches from an
    email thread registered at:
    
    https://commitfest.postgresql.org/patch/5183
    
    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/CAH2-Wz=zzD+752xD8NjVfdxh6c_vRdhWhwRHSw4qXOt=quk=vg@mail.gmail.com
    Author(s): Peter Geoghegan
    Commitfest Bot committed Mar 4, 2025
    Copy the full SHA
    f57c0c0 View commit details
Loading