• Alvaro Herrera's avatar
    Improve snapshot manager by keeping explicit track of snapshots. · 5da9da71
    Alvaro Herrera authored
    There are two ways to track a snapshot: there's the "registered" list, which
    is used for arbitrary long-lived snapshots; and there's the "active stack",
    which is used for the snapshot that is considered "active" at any time.
    This also allows users of snapshots to stop worrying about snapshot memory
    allocation and freeing, and about using PG_TRY blocks around ActiveSnapshot
    assignment.  This is all done automatically now.
    
    As a consequence, this allows us to reset MyProc->xmin when there are no
    more snapshots registered in the current backend, reducing the impact that
    long-running transactions have on VACUUM.
    5da9da71
pl_exec.c 132 KB