From: Tom Lane <tgl@sss.pgh.pa.us>
To: SBob <sbob@quadratum-braccas.com>
Cc: Rui DeSousa <rui@crazybean.net>
Cc: Keith <keith@keithf4.com>
Cc: pgsql-admin <pgsql-admin@postgresql.org>
Subject: Re: Vacuum not cleaning up rows.
Date: Fri, 21 Jun 2019 10:08:22 -0400
Message-ID: <29887.1561126102@sss.pgh.pa.us> (raw)
In-Reply-To: <ef2d3985-cbb4-4d42-a06a-0c8163dc85a7@www.fastmail.com>
References: <15eddc60-6441-e55e-f742-bd7ea37f1873@quadratum-braccas.com>
<31037.1560988222@sss.pgh.pa.us>
<053c95f2-1425-23ac-0308-ca22887db156@quadratum-braccas.com>
<CAHw75vuMizA6F0B+DTbbyG09GYfc8X2d5E+QKt75uXot4bquiA@mail.gmail.com>
<02C3BE5C-ED36-4B36-85C3-90C774FA528B@crazybean.net>
<ef2d3985-cbb4-4d42-a06a-0c8163dc85a7@www.fastmail.com>
SBob <sbob@quadratum-braccas.com> writes:
> I do see older backend_start values (from around 6 hours ago). However I am confused as to how a connection to one database in a cluster can prevenr vacuum from cleaning up row versions in a table within another database. How is that possible since onle one database has access to this table?
Because the snapshot-horizon calculations are done system-wide.
We can't just lobotomize them to only consider the current DB,
because that would result in wrong row-cleanup decisions for shared
catalogs.
There are some attempts to refine that when vacuuming a non-shared table,
but that can only go so far given the limited amount of state that
backends expose about this. Doing better would require expending
more effort in transaction start/transaction stop/snapshot creation,
which are hot spots so it hasn't seemed like it'd be a good tradeoff.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: tgl@sss.pgh.pa.us, sbob@quadratum-braccas.com, rui@crazybean.net, keith@keithf4.com
Subject: Re: Vacuum not cleaning up rows.
In-Reply-To: <29887.1561126102@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox