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.96) (envelope-from ) id 1vJG4p-00GTB5-2o for pgsql-admin@arkaria.postgresql.org; Wed, 12 Nov 2025 19:00:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vJG4n-00DkAv-18 for pgsql-admin@arkaria.postgresql.org; Wed, 12 Nov 2025 19:00:17 +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.96) (envelope-from ) id 1vJG4m-00DkAh-2p for pgsql-admin@lists.postgresql.org; Wed, 12 Nov 2025 19:00:17 +0000 Received: from mail-vk1-xa32.google.com ([2607:f8b0:4864:20::a32]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vJG4l-006mI3-0d for pgsql-admin@lists.postgresql.org; Wed, 12 Nov 2025 19:00:16 +0000 Received: by mail-vk1-xa32.google.com with SMTP id 71dfb90a1353d-559748bcf99so3296e0c.3 for ; Wed, 12 Nov 2025 11:00:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1762974014; x=1763578814; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=YxEeVXoB2KYwZ8tduXes8k1+CeRBSVkMVRmNHKeI4EU=; b=iGZ5T3xbChe1L5AYT5VT+XA6g7HjffyEQLEExDYMCsX4HtxjD/DIx3VLixCQXD0+wN qrtICuaiCPbfuTDhO/24FX18IGTFD4UI7Ce8dytG3M5iq09a4UpTlQaJzURFereGjXAG Z69tB+Q2KSd8aN0HM8bXRNwRb09cvYijExK7U/MTjzHGN80xQJbiYCmKElV7ttQnbe56 L4eQIrV3fFZpcfIJSgbWxGp0zXLmRE1ECDkqbDK2F7z0uG4uW7A2pHjba9FnuievtNiG B+jmahjjuOd8sx41F/bq1oS5aFcFo9O/3KS0OUp0b1IMxgOOxwV47QmY2Hv6rqrIq/xz 2qZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762974014; x=1763578814; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=YxEeVXoB2KYwZ8tduXes8k1+CeRBSVkMVRmNHKeI4EU=; b=BFBbgKgF8A5WXSZwGwQZT0ea3TxkWS51hJC9VJhkCE2WvggM23i98NlafBNMJ0lYhv 6Livu3WMp/qjDdrher+fEzkmfRru9YCW7RVrBSpGfobZlNhN6ENmTS1Woc69A8++mUND oKFmyOppwotJe9T0tv0+QQnL7XLP0m0cOCTEKNFqliikDQYGJzO/7AN+Xrqt/0y8h3pr YR6hnbTydYG2Zok9Mae19cmqSftnFk5cgr6Ao3bdkzGaERAhbwS4j9R1WEokbvsP8zQ7 QyI84JUY60M4qhsX9ptIgFmBQG4T7WhJ9Dlght7jxKvgG1CXrX5Km9KHdEV6TSqOhykt RX2g== X-Gm-Message-State: AOJu0Yz7aq9nWqOvftb4Rni6dSqm2PGtDmH9JKGTANqhtb3xf5Xk4Kkl NSsF392jT1sap6ezrJGv9mdnzOQ7SgFElvc5zq2NZySKRHAIgDa8YSLiZcH7LFYnbzcURDiWr/6 eP1eox4f8tukLMeB/b0JYszOrg2xVgPk= X-Gm-Gg: ASbGncutyoevDHTvr9skoB1Lvgrmdh7CbM+VIfcscRKy+Py3tNU17p1xl4SNI5Kbqtt +uPlHUcMaNQ7N8jC7XhhzekwyWzKRvMItuANsCZlVRam5Kat9fg2Y94M8CfzA+2IxIlnBUzDJ3H fC95NnSCLhDacik153Uyu6uEf9+ZWBfzTlpmWDesHBBWZbcLmVzsMaLDZqibIp/kwZRff2KdC78 Ly6r0bIsHe4Hv3s4zJSIBgkUwGN3wPlRqBj1c5J1RrigcPFdVJCPXqUrZf0cQ== X-Google-Smtp-Source: AGHT+IFv7DWcqqp4uzNQda3zjP8i9hqcleibKusPNLy1dbWELmE/ajFeH/5CeDQfutj3TkQ3m/zRO+FscpCLXzb47L0= X-Received: by 2002:a05:6122:3115:b0:54a:9cff:6fe7 with SMTP id 71dfb90a1353d-559e7c1f664mr1954590e0c.4.1762974014195; Wed, 12 Nov 2025 11:00:14 -0800 (PST) MIME-Version: 1.0 References: <202511121819.yuoha4w6sprz@alvherre.pgsql> In-Reply-To: From: Pavan Kumar Date: Wed, 12 Nov 2025 12:59:36 -0600 X-Gm-Features: AWmQ_bnYhsh_6cuO4vdhYbTQJojdnVI6GB2Gd_7QVzcbrgf7EYNfdAkKQl7u4Fo Message-ID: Subject: Re: vacuum process running for more than 2 days, still in scanning heap phase To: Sbob Cc: pgsql-admin@lists.postgresql.org Content-Type: multipart/alternative; boundary="000000000000dd4aa606436a5f19" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000dd4aa606436a5f19 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hello Sbob, try to use pg_repack. you need to install extension in the database. SET maintenance_work_mem =3D '2GB'; VACUUM (VERBOSE, PARALLEL 4) my_table; >> adjust parallel based on your CPU's I hope this helps On Wed, Nov 12, 2025 at 12:33=E2=80=AFPM Sbob = wrote: > > On 11/12/25 11:26 AM, =C3=81lvaro Herrera wrote: > > On 2025-Nov-12, Sbob wrote: > > > >> We have a vacuum process that has been running for 2 days, the table > >> is 12GB in total size and vacuum_cost_delay is at 0 > > Is it autovacuum? Because if so, the autovacuum_vacuum_cost_delay > > setting would be used instead of this one. Also check the table config > > (\d+) in case there are autovacuum settings there, which could make > > vacuum slower on this particular table. > > > > What PG version again? > > > > This is not autovacuum, we ran a vacuum freeze manyally > > > > Version 15 > > > > >> heap_blks_total | 571437 > >> heap_blks_scanned | 344577 > >> heap_blks_vacuumed | 0 > >> index_vacuum_count | 0 > >> max_dead_tuples | 155388267 > >> num_dead_tuples | 199013 > > Yeah, this seems really slow. Maybe have a look at the wait events in > > pg_stat_activity to see if you can figure out what is holding it back. > pg_stat_activity shows no wait events and shows state as active > >> We actually tried a pg_terminate_backend on it and it does not die > > Hmm, maybe there's something going wrong with it. I've seen corrupted > > btree indexes make a vacuum go into infinite loops because of loops in > > the index structure. I would take a few backtraces with gdb or such. > > Maybe if an index is corrupt in that way, it would also explain why it > > doesn't interrupt. > > > I'll give it a shot, thanks > > > > > > --=20 *Regards,#! Pavan Kumar----------------------------------------------*- *Sr. Database Administrator..!* *NEXT GENERATION PROFESSIONALS, LLC* *Cell # 267-799-3182 # pavan.dba27 (Gtalk) * *India # 9000459083* *Take Risks; if you win, you will be very happy. If you lose you will be Wise * --000000000000dd4aa606436a5f19 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello=C2=A0Sbob,

try to use pg_repack. = you need to install extension in the database.
SET maintenance_wo= rk_mem =3D '2GB';
VACUUM (VERBOSE, PARALLEL 4) my_table; = >> adjust parallel based on your CPU's
I hope this help= s

On Wed, Nov 12, 2025 at 12:33=E2=80=AFPM Sbob= <sbob@quadratum-braccas.c= om> wrote:

--
Regards,

#!=C2=A0 Pavan Kumar
-----------------------= -----------------------
-
Sr. Database Administrator..!

NEXT GENERATION = PROFESSIONALS, LLC
Cell =C2=A0 =C2=A0#=C2=A0 267-799-3182 = #=C2=A0 pavan.dba27 (Gtalk)=C2=A0=C2=A0
India =C2=A0 # 900045908= 3

Take Risks; if you win, you wil= l be very happy. If you lose you will be Wise =C2=A0
--000000000000dd4aa606436a5f19--