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 1ti7CB-00BXWG-J1 for pgsql-admin@arkaria.postgresql.org; Wed, 12 Feb 2025 07:30:07 +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 1ti7C9-0060wL-GB for pgsql-admin@arkaria.postgresql.org; Wed, 12 Feb 2025 07:30:06 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1ti7C9-0060u4-4J for pgsql-admin@lists.postgresql.org; Wed, 12 Feb 2025 07:30:05 +0000 Received: from mail-ed1-x52c.google.com ([2a00:1450:4864:20::52c]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1ti7C7-000Oyg-04 for pgsql-admin@lists.postgresql.org; Wed, 12 Feb 2025 07:30:05 +0000 Received: by mail-ed1-x52c.google.com with SMTP id 4fb4d7f45d1cf-5dea50ee572so2147986a12.1 for ; Tue, 11 Feb 2025 23:30:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec.at; s=google; t=1739345401; x=1739950201; darn=lists.postgresql.org; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:date:to:from:subject:message-id:from:to:cc:subject:date :message-id:reply-to; bh=za7dks6+nonv37p2tzsVtbpx+z5n+a0cSWoSJ408ChI=; b=iNHOz2ictsugRLA5Y/CLWXn7T1zwVPR8lLBmrvKi8qjX6o/nyYkCCIkz7fejyh+VM4 dhrBmH3KcDY0ramL14tXK+cpLanFibwMrImujdXMe5wq0bH8KR63kJSABiNn3BFH1Mtn qhjGQEm2MBIYYJU6HCEySWpE2iMI/KJgtEIKOQAO671hqZotuyTEfkeiY5tc/Gyy89aP c2bs6as+9LpL8QM1Nwosi1HeanjBu1OH2H39dusK8sYu0azBEULePwMjJjAAEi/ghfeP 1j9z5Mcfr+yG9LSvuaLPBxkRQdZp2ZDvatbmN/8xXwXcy0Enq0ZBLuKJ24VwWJYLCYrw +96Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739345401; x=1739950201; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:date:to:from:subject:message-id:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=za7dks6+nonv37p2tzsVtbpx+z5n+a0cSWoSJ408ChI=; b=M6NLcPUAf8fhawL8Oyk22ZKZ+HuUzte3kC9w0moS7asUZjmDmNlOVVmn4cWICTHqVZ lPDXjI6x99wSqLhtwR+AiLUewHG88SFDO33+fkxO0rH+4sSPXCvAn3hTOKBAzPnvDa7J JP6s8Z6aYyWMgflG/QM8liRqf2OsW2+hZU7NR4MvK7KhHcp4PGl7hrqWtkIvkVsjcmKZ ke5V96iH6NP1LO4UOZ73uCHD66o6LMx3RsItnrN+ulTAMH3LHpvYJDGFI63LQ21q7r1X mnvDHE/PUYBZ4EJ2BTP1Ahv01EAOgeyF9dWs/mfKFpobd309hs4rG1sb32C0fKVGU48i ednw== X-Forwarded-Encrypted: i=1; AJvYcCUBW9iqXUmvR3sc8e91lb06zEGTQpxFqtnMp25SYvWNvOr50cFhbfi4ZCs1TXx77E3Pm0HrANQJ4tIHTg==@lists.postgresql.org X-Gm-Message-State: AOJu0YyRajSSP3j9kuBmhTLlMUpBd1lHgOA+vT2t2nWm8c62fmQ+Vbih CdQxrlKSarXkN0ixVTRbRm6LTjdI+vULy04M4YjB5hmzRbF2PfMw9SWlfqGqrUZdPknn9ISKcKw xPETPFJhNh9NFlbHNpXiPaCVKpYiZ1BodOGW7A0874SdXXDDcyQdjT5Ku48UDHJvtZfNz1G5j3W gZUw== X-Gm-Gg: ASbGncs9lQvwqhhu45A2Yw2/YXnx76IcH+Wynv9qQ8lAEhRur0h/Io2I3rt9bHfBRDy LoAjAlaJRCiaSCYcHNOddjpeK0hmqtno6h+jrjntf0tQkN879yXmfEjoRTRWghZI200I5saI7rx 9AvLr5sg826pozSCzfLUgU0U1dEjFWGaa2/EC8hf+UVgYGIcOxjzIJUn24sxmw7+elbxBIwyWCW 3zfh16FlmpL7lJELa46EwOTUnQbzU9odxyuOn/zAiIPaQthR5XR3YCi1KQiPqHY+9+tYPzYhapl 6M5Pwm721547FatKHpodubGA4IT5DUO0 X-Google-Smtp-Source: AGHT+IH5FLcmKTrRuJEPDyR2HaGfCb4OLM97Q7yegkNSrQkKe3LdwWyFQ2tP3gbfT+qCXr+MrYMgIw== X-Received: by 2002:a05:6402:5243:b0:5dc:db28:6afc with SMTP id 4fb4d7f45d1cf-5deadcf6e49mr1976560a12.0.1739345400878; Tue, 11 Feb 2025 23:30:00 -0800 (PST) Received: from localhost.localdomain ([41.66.98.117]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5dcf9f6c77esm10846479a12.69.2025.02.11.23.30.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Feb 2025 23:30:00 -0800 (PST) Message-ID: <1c43ff66a3587ec99b64fff3caa5173ef972f5b1.camel@cybertec.at> Subject: Re: Table size is constantly growing and causing performance problems From: Laurenz Albe To: srinivasan s , pgsql-admin@lists.postgresql.org Date: Wed, 12 Feb 2025 08:29:59 +0100 In-Reply-To: References: User-Agent: Evolution 3.54.3 (3.54.3-1.fc41) MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, 2025-02-12 at 10:14 +0530, srinivasan s wrote: > One of the tables in our database suddenly started=C2=A0 growing very fas= t without > any changes=C2=A0to the environment. it has grown over 10GB in the last w= eek and > this is causing performance issues. We ended up adding an index to solve = the > performance problem but the table growth didn't stop. It is growing conti= nuously. > we are using postgres version 12 on ubuntu That's a mistake. Use a supported version. As it is, you could be sufferi= ng from some already fixed (data corruption?) bug. > We are running a vacuum analsye on a full database every weekend and an a= uto > vacuum is set up. VACUUM (FULL) is also a mistake. It should be a regular VACUUM. Funny, you say that you are experiencing bloat. How can that be if you are running VACUUM (FULL)? Perhaps something is blocking VACUUM from removing dead rows: https://www.cybertec-postgresql.com/en/reasons-why-vacuum-wont-remove-dead-= rows/ > My observation on the DB so far. >=20 > [...] > > 3. Also noticed that there is a auto vacuum=C2=A0job running on the table= with > (to prevent wraparound) >=20 > I am not sure if this auto vacuum (to prevent wraparound) is progressing, > it is running for more than 15 hours and status is active. You should check "pg_stat_progress_vacuum" to see if the numbers are changi= ng, that is, if there is actually any progress. That may also give you a clue = as to how long it will still take. Yours, Laurenz Albe --=20 *E-Mail Disclaimer* Der Inhalt dieser E-Mail ist ausschliesslich fuer den=20 bezeichneten Adressaten bestimmt. Wenn Sie nicht der vorgesehene Adressat= =20 dieser E-Mail oder dessen Vertreter sein sollten, so beachten Sie bitte,=20 dass jede Form der Kenntnisnahme, Veroeffentlichung, Vervielfaeltigung oder= =20 Weitergabe des Inhalts dieser E-Mail unzulaessig ist. Wir bitten Sie, sich= =20 in diesem Fall mit dem Absender der E-Mail in Verbindung zu setzen. *CONFIDENTIALITY NOTICE & DISCLAIMER *This message and any attachment are=20 confidential and may be privileged or otherwise protected from disclosure= =20 and solely for the use of the person(s) or entity to whom it is intended.= =20 If you have received this message in error and are not the intended=20 recipient, please notify the sender immediately and delete this message and= =20 any attachment from your system. If you are not the intended recipient, be= =20 advised that any use of this message is prohibited and may be unlawful, and= =20 you must not copy this message or attachment or disclose the contents to=20 any other person.