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 1hBhL8-0002su-GP for pgsql-general@arkaria.postgresql.org; Wed, 03 Apr 2019 14:58:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hBhL6-0000pe-Jm for pgsql-general@arkaria.postgresql.org; Wed, 03 Apr 2019 14:58:08 +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 1hBhL6-0000pO-AN for pgsql-general@lists.postgresql.org; Wed, 03 Apr 2019 14:58:08 +0000 Received: from mail.hjp.at ([212.17.106.138] helo=rorschach.hjp.at) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hBhKx-00035N-So for pgsql-general@lists.postgresql.org; Wed, 03 Apr 2019 14:58:07 +0000 Received: by rorschach.hjp.at (Postfix, from userid 1000) id E37802744; Wed, 3 Apr 2019 16:57:58 +0200 (CEST) Date: Wed, 3 Apr 2019 16:57:58 +0200 From: "Peter J. Holzer" To: pgsql-general@lists.postgresql.org Subject: Re: Recommendation to run vacuum FULL in parallel Message-ID: <20190403145758.5f7tquc55oblwhsx@hjp.at> References: <9ed59ae2-6eb1-549d-eb05-d1546fd11515@mail.ru> <22db5af2-5593-ef4c-485a-83f3495c48c3@mail.ru> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="s64q5phimu6gbvgq" Content-Disposition: inline In-Reply-To: <22db5af2-5593-ef4c-485a-83f3495c48c3@mail.ru> User-Agent: NeoMutt/20170113 (1.7.2) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --s64q5phimu6gbvgq Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2019-04-03 18:49:02 +0400, rihad wrote: > On 04/03/2019 06:40 PM, Michael Lewis wrote: > > "Sometimes a table's usage pattern involves much more updates than > > inserts, which gradually uses more and more unused space that is never > > used again by postgres, and plain autovacuuming doesn't return it to the > > OS." > >=20 > > Can you expound on that? I thought that was exactly what autovacuum did > > for old versions of rows whether dead because of delete or update, so I > > am surprised by this statement. I thought vacuum full was only ever > > needed if storage space is an issue and the table is not expect to > > quickly re-expand to current size on disk from new churn of tuples. >=20 >=20 > From what I understand from the docs updates keep older versions of rows > intact because other transactions might still use them (this is the essen= ce > of MVCC), and autovacuuming (plain VACUUM) marks that space as available > when it is run, so future inserts can reuse it. And future updates can reuse it, too (an update is very similar to an insert+delete). > In case the number of updates is much greater than the number of > inserts, the unused zombie space gradually creeps up. Not if autovacuum has a chance to run between updates. hp --=20 _ | Peter J. Holzer | we build much bigger, better disasters now |_|_) | | because we have much more sophisticated | | | hjp@hjp.at | management tools. __/ | http://www.hjp.at/ | -- Ross Anderson --s64q5phimu6gbvgq Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEETtJbRjyPwVTYGJ5k8g5IURL+KF0FAlykyfEACgkQ8g5IURL+ KF0huw/6A3CWxxBElPzin82Pc/SunK+dg2ktH0N7bH2xjBop1EuWsZDdN0PFwdZB 2F6em/VvCmw2/LZAg75mC8GQUr/16QsfoRKQ6avBrPxMyoKJznN5XvfU/zmNUF1I dxyYds4As0+VVHNV6YQYPps+goJaOP28sPPD+gC0cX97QoCb7ggM7Q3yUIOhrJgh c5dCw4LhkOHY2u6POwSUp1GtYB1YRSbPLp1IATK0ttXpDXiBOuS7hFSExx9fbXmA L9j4yUErfO2ZiVFTpjq13tw205uCE57j2S5E446RmYRsrM6uXdb/hrYDLayOIRNc OXaBzJhbHqTnfdW6ATxByMpDtBgMp0mmJF8Q70i8ItnwgI0qE4FWrmtDrYBbMKhE tj1Bhl4FuSIPbVz3b2OeTKYBX6VIeCZ9EEVkjPD0tzs6gLd5UoZKorBdq/L+iPBd 1InItYH3CgIbZOAPkbx1yejfzaS57MJLK0zmf5OhP2f9qiBqqA9p5BAm33PkIP/D lL2WqWECuo085nj7f2AGcD321ZOXtS7dUvPmHzn8afLu/8gk9qkVLYMASXwS7hyO YaQvql+GMS9sgVmQ6pBwCONWBdoCxgnaP8WKXf1t0+uKDP5cEZwFVK31yR4leHnm oCmtyUf4mFErZG/KgndICSDd2VN6HJqXQNQn875bxTJ+xNBzaV0= =9Mof -----END PGP SIGNATURE----- --s64q5phimu6gbvgq--