Subject | Re: Very long transaction start after deleting a big number of recor |
---|---|
Author | Aage Frank Johansen |
Post date | 2014-07-26T22:07:44Z |
On 24.07.2014 "un_spoken" wrote:
Thomas Steinmaurer replied:
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.
>> 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 aIf a WHERE clause was used when you deleted half a million records
> 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.
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.