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 1g0zl8-00048N-6Q for pgsql-general@arkaria.postgresql.org; Sat, 15 Sep 2018 01:52:30 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1g0zl3-0002B5-DV for pgsql-general@arkaria.postgresql.org; Sat, 15 Sep 2018 01:52:25 +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 1g0zl2-0002Ay-Oy for pgsql-general@lists.postgresql.org; Sat, 15 Sep 2018 01:52:25 +0000 Received: from resqmta-po-12v.sys.comcast.net ([2001:558:fe16:19:96:114:154:171]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g0zky-0004E7-OV for pgsql-general@lists.postgresql.org; Sat, 15 Sep 2018 01:52:23 +0000 Received: from resomta-po-11v.sys.comcast.net ([96.114.154.235]) by resqmta-po-12v.sys.comcast.net with ESMTP id 0zg9gcwxPWxvn0zksgkz9z; Sat, 15 Sep 2018 01:52:14 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20161114; t=1536976334; bh=p00wF7408KhznwKV0hkp5HA4vfCqULshGNykqH6GpRE=; h=Received:Received:Received:From:To:Subject:Date:Message-ID: MIME-Version:Content-Type; b=VPsp3IP0lKUSsUmm2lXzbzzMLypc9ciNURq1zO2IdGuIdCkB9jcWWBx+0BmJqH5IN PZzw7WpzHZ2NOuy+LhsqzXG0/qPIIoPUUUmujNfCvlzn8hSsHRCOYqQacFZGAnP3o3 FoTk9IZ4IXNW0IjlenWRqIDgUM3pUs/EkGI9z5U2XVnm11ZB3d+Z1m7p9boRJQu5E4 mqekXGtXBf3EovP5QRTx+VTYd41QYEfSWRq8DccB2OjMdSTjqGOgvsQl+7F+EHdHOZ MBdK3XiIcQBXOKaiCH4QERwLI8yDPvdFtLZ2GhKQu6TKkRFgNIM+nWj2nb5yNgKzas 88xmHo6xjUi9g== Received: from jsievers.comcast.net ([70.178.237.138]) by resomta-po-11v.sys.comcast.net with ESMTPA id 0zkhgwHD0dLOw0zkjgQuVX; Sat, 15 Sep 2018 01:52:11 +0000 Received: from jsievers.enova.com (localhost [127.0.0.1]) by jsievers.comcast.net (Postfix) with ESMTP id 37D93260056; Fri, 14 Sep 2018 20:52:03 -0500 (CDT) From: Jerry Sievers To: =?utf-8?Q?Mart=C3=ADn_Fern=C3=A1ndez?= Cc: "pgsql-generallists.postgresql.org" Subject: Re: Vacuum not deleting tuples when lockless References: <5b9c3f8aaa20125720000001@polymail.io> Date: Fri, 14 Sep 2018 20:52:03 -0500 In-Reply-To: <5b9c3f8aaa20125720000001@polymail.io> (=?utf-8?Q?=22Mart?= =?utf-8?Q?=C3=ADn_Fern=C3=A1ndez=22's?= message of "Fri, 14 Sep 2018 16:15:43 -0700") Message-ID: <8736ub5xz0.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: MS4wfE8b3T4PTUgxJJadwodSKKYZox8RaZs6uAFVRF/+HMYKqDvjUmcg2imCjog9CC4tA8BVvNR5R9Z55DYTguK6TAWUAUkczSzFKd1luY8q2+3b790dDAw0 ooKhqpvIFWChEF5m/olfSEYvOVE/iTCC9prxP0CPMUnRyPt7FN9iKuNoljLOZ6BncuWU7Vwvs/YlhpGSwGvlDDO9gKcY3TiygX8t0I21wdkx9bYadJtE4bmR List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Mart=C3=ADn Fern=C3=A1ndez writes: > * > Hello, > > 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. > ``` > > I've been investigating the reasons for vacuum not being able to do > it's work and I found that generally the problem is caused by open > transactions referencing the dead tuples. I also found that locking > can be a problem as well. > > I did check that no long running transaction was happening and no > locking was happening before running `vacuum` on the given table. > > I used this query to check the locks: > > ``` > SELECT query, state,locktype,mode > FROM pg_locks > JOIN pg_stat_activity > USING (pid) > WHERE relation::regclass =3D 'my_table'::regclass > AND granted IS TRUE; > ``` > > I'm not sure where else to look for a potential issue that could be > causing this problem. A few days back we had to use re_pack on the Also check for... * Old open prepared xacts. * Inactive replication slots. * Standbys confi'd with large vacuum clean up delay and feedback enabled. HTH > given table to solve our performance issues. > > Important thing to clarify is that we are using postgresql 9.2.24 > > Thanks in advance! > > Best, > Mart=C3=ADn > > --=20 Jerry Sievers Postgres DBA/Development Consulting e: postgres.consulting@comcast.net p: 312.241.7800