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

Commits on Oct 30, 2025

  1. Add function to log the plan of the currently running

    Currently, we have to wait for the query execution to finish
    to know its plan either using EXPLAIN ANALYZE or auto_explain.
    This is not so convenient, for example when investigating
    long-running queries on production environments.
    To improve this situation, this patch adds pg_log_query_plan()
    function that requests to log the plan of the currently
    executing query.
    
    On receipt of the request, ExecProcNodes of the current plan
    node and its subsidiary nodes are wrapped with
    ExecProcNodeFirst, which implelements logging query plan.
    When executor executes the one of the wrapped nodes, the
    query plan is logged.
    
    Our initial idea was to send a signal to the target backend
    process, which invokes EXPLAIN logic at the next
    CHECK_FOR_INTERRUPTS() call. However, we realized during
    prototyping that EXPLAIN is complex and may not be safely
    executed at arbitrary interrupt points.
    
    By default, only superusers are allowed to request to log the
    plans because allowing any users to issue this request at an
    unbounded rate would cause lots of log messages and which can
    lead to denial of service.
    
    Todo: Consider removing the PID from the log output of
    pg_log_backend_memory_contexts() and pg_log_query_plan().
    For detail, see the discussion:
    
    https://www.postgresql.org/message-id/CA%2BTgmoY81r7npTS34N_5MLA_u6ghfor5HoSaar53veXUYu1OxQ%40mail.gmail.com
    Atsushi Torikoshi authored and Commitfest Bot committed Oct 30, 2025
    Configuration menu
    Copy the full SHA
    2abb0b9 View commit details
    Browse the repository at this point in the history
  2. [CF 5330] v50 - Logging plan of the currently running query

    This branch was automatically generated by a robot using patches from an
    email thread registered at:
    
    https://commitfest.postgresql.org/patch/5330
    
    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/[email protected]
    Author(s): Atsushi Torikoshi
    Commitfest Bot committed Oct 30, 2025
    Configuration menu
    Copy the full SHA
    b7bb20c View commit details
    Browse the repository at this point in the history
Loading