Subject Re: Very long transaction start after deleting a big number of recor
Author Aage Frank Johansen
On 24.07.2014 "un_spoken" wrote:
>> 1. I've deleted 500000 records from TABLE A. I've commited transaction.
>> 2. I made SELECT * FROM TABLE A. Transaction was starting for a very
>> long time.
>>
>> I just wanted to make sure that there is no way to prevent this
>> behaviour? I mean, I can not delay somehow clearing of this garbage?
>>
...

Thomas Steinmaurer replied:
> SELECT COUNT(*) might be better because all pages are read and only a
> single value is transferred to the client. And the whole only works as
> advertised when old record versions are no longer "interesting" to other
> concurrent transactions.

If a WHERE clause was used when you deleted half a million records
you might improve a bit on the
"select count(*) ..." if you included the same WHERE clause. There
might, however, be situations where this advice may not apply.

--
Aage J.