• Tom Lane's avatar
    Track the current XID wrap limit (or more accurately, the oldest unfrozen · 25ec228e
    Tom Lane authored
    XID) in checkpoint records.  This eliminates the need to recompute the value
    from scratch during database startup, which is one of the two remaining
    reasons for the flatfile code to exist.  It should also simplify life for
    hot-standby operation.
    
    To avoid bloating the checkpoint records unreasonably, I switched from
    tracking the oldest database by name to tracking it by OID.  This turns
    out to save cycles in general (everywhere but the warning-generating
    paths, which we hardly care about) and also helps us deal with the case
    that the oldest database got dropped instead of being vacuumed.  The prior
    coding might go for a long time without updating the wrap limit in that case,
    which is bad because it might result in a lot of useless autovacuum activity.
    25ec228e
pg_resetxlog.c 27.8 KB