• Robert Haas's avatar
    Fix some problems with VACUUM (INDEX_CLEANUP FALSE). · dd695979
    Robert Haas authored
    The new nleft_dead_tuples and nleft_dead_itemids fields are confusing
    and do not seem like the correct way forward.  One of them is tested
    via an assertion that can fail, as it has already done on buildfarm
    member topminnow.  Remove the assertion and the fields.
    
    Change the logic for the case where a tuple is not initially pruned
    by heap_page_prune but later diagnosed HEAPTUPLE_DEAD by
    HeapTupleSatisfiesVacuum.  Previously, tupgone = true was set in
    that case, which leads to treating the tuple as one that will be
    removed.  In a normal vacuum, that's OK, because we'll remove
    index entries for it and then the second heap pass will remove the
    tuple itself, but when index cleanup is disabled, those things
    don't happen, so we must instead treat it as a recently-dead
    tuple that we have voluntarily chosen to keep.
    
    Report and analysis by Tom Lane.  This patch loosely based on one
    from Masahiko Sawada, but I changed most of it.
    dd695979
vacuumlazy.c 73.8 KB