Skip site navigation (1) Skip section navigation (2)

understanding the interaction with delete/select/vacuum

From: Alan Stange <stange(at)rentec(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: understanding the interaction with delete/select/vacuum
Date: 2005-08-29 19:11:14
Message-ID: (view raw, whole thread or download thread mbox)
Lists: 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?


-- Alan


pgsql-novice by date

Next:From: Oren MazorDate: 2005-08-29 19:18:48
Subject: Re: understanding the interaction with delete/select/vacuum
Previous:From: Oren MazorDate: 2005-08-29 18:43:30
Subject: array vs flat tables performance

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group