Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tqVhG-0061CH-8z for pgsql-general@arkaria.postgresql.org; Fri, 07 Mar 2025 11:16:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tqVhE-00HMrv-Uq for pgsql-general@arkaria.postgresql.org; Fri, 07 Mar 2025 11:16:52 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tqVhE-00HMn8-K3 for pgsql-general@lists.postgresql.org; Fri, 07 Mar 2025 11:16:52 +0000 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tqVhC-001Tyj-2T for pgsql-general@lists.postgresql.org; Fri, 07 Mar 2025 11:16:51 +0000 Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-388cae9eb9fso809804f8f.3 for ; Fri, 07 Mar 2025 03:16:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1741346209; x=1741951009; darn=lists.postgresql.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=bUE9YTc5ipq3IHJmMBTHNSLZEUcb/SKax6bnoZQMRH0=; b=Po0bG3f4nvTX+wK0IOYBenPrtpaDcjHZ9DEuKGh4cQUe6dfKMN75IEnU7AnM4yDa3o w4fjf6nywu1DmUJ3xqoi2PoxDpJpeecEBX4NAzj2m3/Hj2MZlrozAen5dGFawgQ2lSqs pOEsltCDLvVP5/sD+P9YToQUZ0AU9bdkzWdOFvNCGyO8gAtIEmqDpOoFf5uN4XkqY9Mu AFnEjv06MFigy8/8aCpC7IcFde8C4GT+gzfYMxhSg7TVh4QWmHO+E/LoDAvYS7LCZpi2 WMhI5gHoEwtUyxhW95aQAQ/Rn2Zeo6ucfROohdXPkYTPiMV7qejRf2bh9SUtdqn7sJ2s EVaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741346209; x=1741951009; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=bUE9YTc5ipq3IHJmMBTHNSLZEUcb/SKax6bnoZQMRH0=; b=Y1bmM0pUbWlJH8q3s/lgFRTLN0omiY4HjCuN+3LAPltUtWyBVTbienjLgh85niGIyF mNieiXpyZvPLd5BuKXe+ZyRz1iC6hznnZWD7dxcu+mNjLBHMShmbZqYlPxSSTOihdK9G qOQa7NkUmy62abKe8Y+IXShAyI+L71BmBnlfiv7dGIvMlyMM8/J6HSeXaXAKTlG5vUsu S2TsO26vNvWoVVxX19vnYn3qKZBgMJ0RHtOHl0NxSBJ6KItAyUrq1Uy/t+k85UhEMX8A 1x+SRUeiKXkYOixjuHG7vYeH0Ttq7yhbjGBPZdCMYFPn6tiMtKAHt3kpe1ya//iLNcxq ZdoQ== X-Gm-Message-State: AOJu0Yzy7ZAWia/1oB2tnpaq1n+Zc+3ABN84mDfVlMQjVyw5w1Vhfvxi 7wq7lJMwnMsLJqoP4wTUWBJUQke2kUXkATQ49QpqsPoV/Af7uk8oCDo20+QwoCB6V/qgwgav7A+ fqRFkJhGTDJsx2V3IhfBpp7cDcDWRQ/XQ X-Gm-Gg: ASbGncsgYBZBnsnQjXS0d9AJs9cfSaplLw4Jk7ZIoBC4Cihr3xBEkSkdh9umBlTnNvh tkqdFJtP1n0A1Sc3xrpLaSa1kMrwkUK70atROlrW9nLwSdjulCQztq+dEyxIICGhUAEc3uQlAh3 ue7wE7Ouhzn1JLdGE07aOq+0Y= X-Google-Smtp-Source: AGHT+IFsOnSRXI4ZOwbqiM7PrpEEmdrEUONr4G/uxweC8XRQTFTuNqTE4YPCi5c8nrp6QkwZ8ZxvhZv7Ow4QE42KcvY= X-Received: by 2002:a05:6000:18a3:b0:391:2df9:772d with SMTP id ffacd0b85a97d-39132d3bad8mr1919386f8f.13.1741346209442; Fri, 07 Mar 2025 03:16:49 -0800 (PST) MIME-Version: 1.0 From: Bartosz Stalewski Date: Fri, 7 Mar 2025 12:16:38 +0100 X-Gm-Features: AQ5f1Jqo2JvE2qlF45vCZbEcx54byd-AJqdljXZQFLT4qSxERubWjRpEhO6q_k4 Message-ID: Subject: Vacuum related question To: pgsql-general@lists.postgresql.org Content-Type: multipart/alternative; boundary="0000000000003eb4ca062fbec234" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000003eb4ca062fbec234 Content-Type: text/plain; charset="UTF-8" Hello All! I'm currently using 17.2 version and working on optimizing vacuums. I would be greateful if you could confirm (or deny) my idea. Current situation: Every 4-5 days vacuum to prevent wraparound is running in my DB, which of course is bad. There are a few tables that are constantly being updated (both inserts and updates) - they are quite big - ranging from a few hundred million to over a billion rows. Other tables get only inserts (with similar size - they may reach over a billion rows). Solution: I would like to have a quick vacuum to freeze old tuples - it would be quick because it would omit indexes (because switch INDEX_CLEANUP would be set as false). Additionally for tables with dead tuples I would run vacuum with INDEX_CLEANUP set as true during weekend. Omitting indexes makes a huge difference in terms of vacuum time. Would it be a problem from performance point of view (e.g. accumulating some bloat?) if tables that do not contain dead tuples are vacuumed only with flag INDEX_CLEANUP set as false? I have a feeling that it is fine, but unfortunately I couldn't find any clear evidence when browsing Internet. Thanks in advance, Bartek --0000000000003eb4ca062fbec234 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello All!

I'm currently using 17.2 version and= working on optimizing vacuums.
I would be greateful if you could confir= m (or deny) my idea.

Current situation:
Every 4-5 days vacuum to = prevent wraparound is running in my DB, which of course is bad. There are a= few tables that are constantly being updated (both inserts and updates) - = they are quite big - ranging from a few hundred million to over a billion r= ows.
Other tables get only inserts (with similar size - they may reach o= ver a billion rows).

Solution:
I would like to have a quick vacuu= m to freeze old tuples - it would be quick because it would omit indexes (b= ecause switch INDEX_CLEANUP would be set as false). Additionally for tables= with dead tuples I would run vacuum with INDEX_CLEANUP set as true during = weekend. Omitting indexes makes a huge difference in terms of vacuum time.<= br>
Would it be a problem from performance point of view (e.g. accumulat= ing some bloat?) if tables that do not contain dead tuples are vacuumed onl= y with flag INDEX_CLEANUP set as false? I have a feeling that it is fine, b= ut unfortunately I couldn't find any clear evidence when browsing Inter= net.

Thanks in advance,
Bartek
--0000000000003eb4ca062fbec234--