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 1hBmJL-0000UO-Ek for pgsql-general@arkaria.postgresql.org; Wed, 03 Apr 2019 20:16:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hBmJK-0004Zm-1M for pgsql-general@arkaria.postgresql.org; Wed, 03 Apr 2019 20:16:38 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hBmJJ-0004Zf-Bl for pgsql-general@lists.postgresql.org; Wed, 03 Apr 2019 20:16:37 +0000 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hBmJG-0002Jf-Hg for pgsql-general@postgresql.org; Wed, 03 Apr 2019 20:16:36 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id EE98528D40; Wed, 3 Apr 2019 16:16:33 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Wed, 03 Apr 2019 16:16:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= stepheneilert.com; h=date:from:to:cc:message-id:in-reply-to :references:subject:mime-version:content-type; s=mesmtp; bh=P8sb gaP/pb1ZStENwL8p8AQpl6KNF1XsSbuOw4T+Rhg=; b=ZvR5dNiy5vueRrbGDxUG A3s3mat0BZj7ojxm77rAu8ut/BLIGvtRgTFkxLIvOcxV6LnY8U6ImRCq96KjRRLM xBc5ATQaXg6o+Eo3l3lICsVuMxqT52PR5K9My16VaEm2ysxvj+WTpf0jIQd+ZKMp hKHkWPEbUDfUp0ULDR0YTZo= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc: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=fm2; bh=P8sbga P/pb1ZStENwL8p8AQpl6KNF1XsSbuOw4T+Rhg=; b=dKEC12twNso6zb2nxKj1W0 wt+uchml7JPuBiKLpLaO2Oyc3IBwK1wJD/1dlFt0VfQeZIE7KCD+h3R07cZ4guv/ BZIjAzQTW6Ib9hMhq7Oz/T5+4drwFGXHEx3x9M2pLCofIJHDUq+CCLrB3wM7tMUa SqTk2V4YYehKYTJrYhyBWFBQhLApOlVyVuAo4BNr8yFaLw1GwBsmoU9e9fj2Q6Jc DrFc4Hgcjqm2GnXb54GdeJeQsKe9nzjkWw2ADdqT+Lv8nh1FW+3dEeI5ivF8duC/ p7798TULw0y6eJwoKhYLnrH13u64N4dSvG5uQATPRGfT0i0SMprzHVSW++0RkQrg == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduuddrtdefgdduvddtucdltddurdeguddtrddttd dmucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpih gvnhhtshculddquddttddmnecujfgurhepfffhvffkjghfufggtgesrgdtreertddtjeen ucfhrhhomhepufhtvghphhgvnhcugfhilhgvrhhtuceotghonhhtrggtthesshhtvghphh gvnhgvihhlvghrthdrtghomheqnecukfhppedutdegrdefiedrvdegkedrudefnecurfgr rhgrmhepmhgrihhlfhhrohhmpegtohhnthgrtghtsehsthgvphhhvghnvghilhgvrhhtrd gtohhmnecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from [15.111.202.82] (ext-104-36-248-13.arubanetworks.com [104.36.248.13]) by mail.messagingengine.com (Postfix) with ESMTPA id 9FFCD1031A; Wed, 3 Apr 2019 16:16:32 -0400 (EDT) Date: Wed, 3 Apr 2019 13:16:25 -0700 From: Stephen Eilert To: rihad , Perumal Raj Cc: hjp-pgsql@hjp.at, pgsql-general General Message-ID: In-Reply-To: References: <9ed59ae2-6eb1-549d-eb05-d1546fd11515@mail.ru> Subject: Re: Recommendation to run vacuum FULL in parallel X-Readdle-Message-ID: c7120012-72ea-4c2f-bb32-f70b213d53f1@Spark MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="5ca5149e_2901d82_f5a" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --5ca5149e_2901d82_f5a Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline >=C2=A0Ideally VACUUM =46ULL should not require a giant lock on the table= . It is a massively expensive operation, regardless. Not sure if it is some= thing you want to run in production outside a maintenance window. I would argue that frequent vacuum full is an antipattern. This will beco= me a matter of superstition in your company. If db size growth is a problem, make autovacuum more agressive. Or run yo= ur manual vacuum job (not full) more often than a week. Daily, if you hav= e to. This will not reclaim disk space as reported by the OS, but it shou= ld make the space available for new row versions, so db should mostly sto= p growing from the OS point of view(mostly, because you may be adding new= data, right=3F). If it is still a problem, then there may be something e= lse going on. Which PG version is that=3F =E2=80=94 Stephen On Apr 3, 2019, 10:02 AM -0700, Perumal Raj , wrot= e: > Hi All > > Thanks for all your valuable=C2=A0 inputs, > > Here is some more data, > > Though we have 150 GB free space spread across 500 Tables , Every alter= native day DB is growing with 1 GB rate. > Also,We have manual vacuum job scheduled to run weekly basis, So seems = to be space is not reusing all the time =3F > > So conclude the requirement here , The only way to parallelism is multi= ple script. And no need to do REINDEX exclusively. > Question : Do we need to consider=C2=A0 Table dependencies while prepar= ing script in order to avoid table locks during vacuum full =3F > > At present Maintenance work memory set to 20 GB. > Question : Do we need to tweak any other parameters =3F > > Note: > We are planning this activity with Application Downtime only. > > Let me know if i missed anything. > > Regards, > Raj > > > > > > > On Wed, Apr 3, 2019 at 8:42 AM rihad wrote: > > > > And future updates can reuse it, too (an update is very similar t= o an > > > > insert+delete). > > > > > > > > > Hm, then it's strange our DB takes 6 times as much space compared t= o > > > freshly restored one (only public schema is considered). > > > > > > > Not if autovacuum has a chance to run between updates. > > > > > > Ours is run regularly, although we had to tweak it down not to inte= rfere > > > with normal database activity, so it takes several hours each run o= n the > > > table. We did that by setting autovacuum=5Fvacuum=5Fscale=5Ffactor = =3D 0.05 from > > > default 0.2. > > > > > > --5ca5149e_2901d82_f5a Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline
>&=23160;Ideally VACUUM =46ULL should not require a giant lock on= the table.

It is a massively expensive operation, regardless. Not sure if it is= something you want to run in production outside a maintenance window.

I would argue that frequent vacuum full is an antipattern. This will beco= me a matter of superstition in your company.

If db size growth is a problem, make autovacuum more agressive. Or r= un your manual vacuum job (not full) more often than a week. Daily, if yo= u have to. This will not reclaim disk space as reported by the OS, but it= should make the space available for new row versions, so db should mostl= y stop growing from the OS point of view(mostly, because you may be addin= g new data, right=3F). If it is still a problem, then there may be someth= ing else going on.

Which PG version is that=3F


=E2=80=94 Stephen
On Apr 3, 2019,= 10:02 AM -0700, Perumal Raj <perucinci=40gmail.com>, wrote:
Hi All

Thanks for all your valuable&=23160; inputs,

Here is some more data,

Though we have 150 GB free space spread across 500 Tables , Every al= ternative day DB is growing with 1 GB rate.
Also,We have manual vacuum job scheduled to run weekly basis, So see= ms to be space is not reusing all the time =3F

So conclude the requirement here , The only way to parallelism is mu= ltiple script. And no need to do REINDEX exclusively.
Question : Do we need to consider&=23160; Table dependencies while p= reparing script in order to avoid table locks during vacuum full =3F

At present Maintenance work memory set to 20 GB.
Question : Do we need to tweak any other parameters =3F

Note:&=23160;
We are planning this activity with Application Downtime only.

Let me know if i missed anything.

Regards,
Raj
&=23160;




--5ca5149e_2901d82_f5a--