understanding the interaction with delete/select/vacuum - Mailing list pgsql-novice

From Alan Stange
Subject understanding the interaction with delete/select/vacuum
Date
Msg-id 43135DD2.6090004@rentec.com
Whole thread Raw
Responses Re: understanding the interaction with delete/select/vacuum  ("Oren Mazor" <oren.mazor@gmail.com>)
Re: understanding the interaction with delete/select/vacuum  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-novice
Hello all,

say for example I have a larger table T with 26 millions rows, one
million associated with each letter of the alphabet.

I have a long running process which does a 'SELECT ID FROM T'.  The
results are being streamed to the client using a fetch size limit.  This
process with take 26 hours to run.    It turns out that all the "C" and
"P" are going to be deleted when the SELECT gets to them.

Several hours into this process, after the "C" rows have been deleted in
a separate transaction but we haven't yet gotten to the "P" rows, a
vacuum is begun on table T.


What happens?

Will the 1 million "C" rows be freed and made available for reuse or
will their visibility with the initial SELECT statement cause the vacuum
to skip over them?

Thanks!

-- Alan

pgsql-novice by date:

Previous
From: "Oren Mazor"
Date:
Subject: array vs flat tables performance
Next
From: "Oren Mazor"
Date:
Subject: Re: understanding the interaction with delete/select/vacuum