Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1heKGl-0002AI-JY for pgsql-admin@arkaria.postgresql.org; Fri, 21 Jun 2019 14:11:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1heKGk-0003ys-Fg for pgsql-admin@arkaria.postgresql.org; Fri, 21 Jun 2019 14:11:58 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1heKGk-0003w7-3r for pgsql-admin@lists.postgresql.org; Fri, 21 Jun 2019 14:11:58 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1heKGh-0001Kd-RB for pgsql-admin@lists.postgresql.org; Fri, 21 Jun 2019 14:11:57 +0000 Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 519B622247 for ; Fri, 21 Jun 2019 10:11:54 -0400 (EDT) Received: from imap1 ([10.202.2.51]) by compute7.internal (MEProxy); Fri, 21 Jun 2019 10:11:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= quadratum-braccas.com; h=mime-version:message-id:in-reply-to :references:date:from:to:subject:content-type; s=fm2; bh=uCSIrHd 1xTP0wtfA5QJom8brTJhYUa2FZDFZ3yl6cBI=; b=ExEVAehJuxbYa+6M8ie+FAz Z7wGD2iypHpC+4orxZyr51MojHc/o6dGmL6TSR4dOBTi6Yh9r05zJqdBLNwXgYFE 75UmjAPAaCUv5YqTuqg2KFB+k1JKcVFH8iKCPeDxow23UT8h1hDZTScHfrMJ3Jr/ ptPcjxO0yIswaRjGP63Cxrj0UTesVLFXcGCETlyiBksV3h2XT+JTBGpUj5PzfyfG o0dQFfsQM1v/XOIwBvtVKy3tTBjz2gKqSquW9reyYBvuwbQg8kqDdanctxvbMrDf 2BKyVb6a0G5SWqA8/+JhznLQeIKiSjCRmfG+CFS8tQag641NScmo8Z4EZ0aEAjQ= = DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=uCSIrH d1xTP0wtfA5QJom8brTJhYUa2FZDFZ3yl6cBI=; b=d5JHZwPBrpdOoHBPFiFvBM oAZpLvsf/wct+WMDZ0gbqYF2Aw1KJuRCtsqwJTHAr8PaLXs56up/C0RlV5uG2Vf1 pYCpffbvu8r3y0upD/kByZNOLY+VMhniBHjIjI+OmNK34BPFkTwLrDZV48b+aOOe xLztyFWf8Wo//DCX2cM0/pOf2NqpL6jCc4awoVSj5DEa25BGuXwVHoHqg/aC4DmA NFNWt3Px0lcvH17iRs+74HmP/KAOmO8tb02L4f62UfazGUWYx43cdE9oKTrWkHe7 T3dOot3jAUHYrd9CAFAfMNI8+UGnWXitnhq66XljtNlchU+vIfChif9cP8EO83cw == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrtdeigdejiecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepofgfggfkjghffffhvffutgesrgdtre erreertdenucfhrhhomhepufeuohgsuceoshgsohgssehquhgrughrrghtuhhmqdgsrhgr tggtrghsrdgtohhmqeenucfrrghrrghmpehmrghilhhfrhhomhepshgsohgssehquhgrug hrrghtuhhmqdgsrhgrtggtrghsrdgtohhmnecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id E11AFC200A3; Fri, 21 Jun 2019 10:11:53 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.1.6-728-g133121a-fmstable-20190620v1 Mime-Version: 1.0 Message-Id: <9887eca2-9316-4f76-bc7b-545d7ccf516d@www.fastmail.com> In-Reply-To: <29887.1561126102@sss.pgh.pa.us> References: <15eddc60-6441-e55e-f742-bd7ea37f1873@quadratum-braccas.com> <31037.1560988222@sss.pgh.pa.us> <053c95f2-1425-23ac-0308-ca22887db156@quadratum-braccas.com> <02C3BE5C-ED36-4B36-85C3-90C774FA528B@crazybean.net> <29887.1561126102@sss.pgh.pa.us> Date: Fri, 21 Jun 2019 10:11:52 -0400 From: SBob To: pgsql-admin@lists.postgresql.org Subject: Re: Vacuum not cleaning up rows. Content-Type: multipart/alternative; boundary=e5b9d476ad2c4f429f0b2d1064f46f98 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --e5b9d476ad2c4f429f0b2d1064f46f98 Content-Type: text/plain Got it. can someone point me to more reading on snapshots and snapshot-horizon? Thanks! On Fri, Jun 21, 2019, at 10:08 AM, Tom Lane wrote: > SBob 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 > > > --e5b9d476ad2c4f429f0b2d1064f46f98 Content-Type: text/html Content-Transfer-Encoding: quoted-printable
Got it. can som= eone point me to more reading on snapshots  and snapshot-horizon?

Thanks!



On Fri, Jun 21, 2019, at 10:08 AM, Tom Lane wrote= :
SBob <sbob@quadra= tum-braccas.com> writes:
> I do see older backend_st= art 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 possibl= e 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 curren= t DB,
because that would result in wrong row-cleanup decis= ions for shared
catalogs.

The= re are some attempts to refine that when vacuuming a non-shared table,
but that can only go so far given the limited amount of sta= te that
backends expose about this.  Doing better wou= ld require expending
more effort in transaction start/tran= saction stop/snapshot creation,
which are hot spots so it = hasn't seemed like it'd be a good tradeoff.

regards, tom lane




--e5b9d476ad2c4f429f0b2d1064f46f98--