Re: 答复: autovacuum can not remove dead tuples - Mailing list pgsql-bugs

From Sergei Kornilov
Subject Re: 答复: autovacuum can not remove dead tuples
Date
Msg-id 2899571522824321@web50j.yandex.ru
Whole thread Raw
In response to 答复: autovacuum can not remove dead tuples  (石勇虎 <SHIYONGHU651@pingan.com.cn>)
List pgsql-bugs
Hello
Yes, any session in transaction will prevent vacuum some rows. Regardless DISABLE_PAGE_SKIPPING or any other option,
thisis not bug. Vacuum should not remove any deleted row which can be accessible by any running transaction.
 
You can use idle_in_transaction_session_timeout to prevent long idle in transaction state. But i use simple crontab
likethis:
 
*/10 * * * * psql -d postgres -tx -c "SELECT pg_terminate_backend(pid),now(),now()-xact_start as duration,* from
pg_stat_activitywhere (now() - pg_stat_activity.xact_start) > '1 hour'::interval and usename NOT IN ('postgres') and
state<>'idle'"
to terminate any long running transaction. Time interval changed by database workload, for web requests can be 5min.

regards, Sergei


pgsql-bugs by date:

Previous
From: 石勇虎
Date:
Subject: 答复: autovacuum can not remove dead tuples
Next
From: Michael Paquier
Date:
Subject: Re: BUG #14999: pg_rewind corrupts control file global/pg_control