Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g10LX-0006m9-KZ for pgsql-general@arkaria.postgresql.org; Sat, 15 Sep 2018 02:30:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1g10LV-0005SL-PZ for pgsql-general@arkaria.postgresql.org; Sat, 15 Sep 2018 02:30:05 +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_SHA384:256) (Exim 4.89) (envelope-from ) id 1g10LV-0005SE-HY for pgsql-general@lists.postgresql.org; Sat, 15 Sep 2018 02:30:05 +0000 Received: from resqmta-ch2-12v.sys.comcast.net ([2001:558:fe21:29:69:252:207:44]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g10LR-000520-Bp for pgsql-general@lists.postgresql.org; Sat, 15 Sep 2018 02:30:04 +0000 Received: from resomta-ch2-17v.sys.comcast.net ([69.252.207.113]) by resqmta-ch2-12v.sys.comcast.net with ESMTP id 10H8gZuLEutrU10LMgNE1e; Sat, 15 Sep 2018 02:29:56 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20161114; t=1536978596; bh=jyf4VXjh8Uuy9b9P2S0SNjcRRSuRQ1CQAh7NQJW34tM=; h=Received:Received:Received:From:To:Subject:Date:Message-ID: MIME-Version:Content-Type; b=Kn8FHohy0Tty5IOWcXFzA+2YZKsnIjVko9zUjz9NrwWyO2Y62KDoPc283Y5HcKlZJ 8QNCNBP9hMFtJP6Ct8M/qxPpEeYoWN+yh55rVgNc4M3UEWZDtVNP6Bdl0+hzsREwjS mUuSAFQBNIwtqx+eZQrVh6ZSqH9ibSDU187rXFc7BldOYCIVQ8XmMpG5BvcJnGUE30 3DytC7TXE1MF4XagSD6mT2/jsTLPKMss/q7AWsTazaUm1f1T3mS5SMRPeKjdMVgOVl EMgp9Ns2v+YqGLcWC79LGJzWPUQhIR5CsIqFy09oyIJ0feNOCqcCCHaxUg5yOxl+4w gBEnuJhqdKMCw== Received: from jsievers.comcast.net ([12.30.159.20]) by resomta-ch2-17v.sys.comcast.net with ESMTPA id 10LBg2wpk4dBe10LCg1O4U; Sat, 15 Sep 2018 02:29:54 +0000 Received: from jsievers.enova.com (localhost [127.0.0.1]) by jsievers.comcast.net (Postfix) with ESMTP id DBDBE260056; Fri, 14 Sep 2018 21:29:44 -0500 (CDT) From: Jerry Sievers To: Tom Lane Cc: =?utf-8?Q?Mart=C3=ADn_Fern=C3=A1ndez?= , "pgsql-generallists.postgresql.org" Subject: Re: Vacuum not deleting tuples when lockless References: <5b9c3f8aaa20125720000001@polymail.io> <13361.1536977825@sss.pgh.pa.us> Date: Fri, 14 Sep 2018 21:29:44 -0500 In-Reply-To: <13361.1536977825@sss.pgh.pa.us> (Tom Lane's message of "Fri, 14 Sep 2018 22:17:05 -0400") Message-ID: <87y3c34hnr.fsf@jsievers.enova.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-CMAE-Envelope: MS4wfEJ6FSb5+heW8qm5svCjzDu0TMh6PIJe+Nq9EQ1kE26hWH4JHsKGEdybUaNksbCHinYvTvgO9fCc+Lke4bM/i/P7wd7BbthHQoe06lKLFpiBwAITU3nF Dn0UpsB4YQsixe0lCQcZZ9dXlTyYF9e8Jm76ER3P7j/9fvp7OT03UPfJr/khB4RSgp46IlIlJrrizloO1VEbsKzeSw0suFqKIUgwBpGHZb+AlbpnnyUvLObE apcQ64PH3xiCz23Pdxm7mw== List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Tom Lane writes: > =3D?UTF-8?q?Mart=3DC3=3DADn_Fern=3DC3=3DA1ndez?=3D = writes: > >> We are experiencing some `vacuum` issues with a given table >> (potentially more). When a manual vacuum runs on the given table it >> seems that the `vacuum` process is not doing the expected cleanup. > >> DETAIL:=E2=80=82=E2=80=82113257 dead row versions cannot be removed yet. > > Locks don't really have anything to do with that: what does matter is > how old is the oldest open transaction, because that determines the > "event horizon" that dead row versions have to fall below before they > can be removed. That oldest transaction might not be holding any locks > at the moment, but it doesn't matter, because in principle it could ask > to read this table later --- and it should see the table's contents as > of its snapshot. > > Serializable transactions are worse than repeatable-read transactions > for this purpose, because the former will keep a snapshot as of their > start time. > > As Jerry mentioned, replication slots can also act like open transactions > for this purpose, though I don't recall how much of that behavior is > present in 9.2.x. Oops, didn't notice OP was on 9.2! Presume none, since I don't think we got rep slots till 9.4 :-) > > regards, tom lane > > --=20 Jerry Sievers Postgres DBA/Development Consulting e: postgres.consulting@comcast.net p: 312.241.7800