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 1tYfex-00CxKf-Ch for pgsql-admin@arkaria.postgresql.org; Fri, 17 Jan 2025 06:16:47 +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 1tYfev-009F4Y-V3 for pgsql-admin@arkaria.postgresql.org; Fri, 17 Jan 2025 06:16:46 +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 1tYfev-009F2w-JV for pgsql-admin@lists.postgresql.org; Fri, 17 Jan 2025 06:16:46 +0000 Received: from mail-ej1-x62d.google.com ([2a00:1450:4864:20::62d]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tYfet-000tQ2-2b for pgsql-admin@lists.postgresql.org; Fri, 17 Jan 2025 06:16:45 +0000 Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-aaef00ab172so264764266b.3 for ; Thu, 16 Jan 2025 22:16:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737094602; x=1737699402; darn=lists.postgresql.org; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=ysqHYEjVA5Jdp2++CgG77DbXpuqMsg5Dhjh+TNPFaO0=; b=jqOUOL4CEyiiYyqDaGX/4sYBWkm1vQ1o0ultTb6+v6zU7bK/5Sg3nNhFO1vVBtYgwx GZy7nFqKyqW/22gu/qLgIqa3YNORnA+9HnRlznuJ53LuCMcrgZ3VcW+Tq7HkCvE3WT+D 0oglILPp34l747Rbnym6WQsW//dNBCZpbguq4bJf4P7m3e36aLT6Uphccg4XjUTeJA+d zHa7aW96w6yZ4DGn4czWb8Nw2bw+QCILpYV99ff39I1mWhqNvOhGxAHIWML2lnzJtflr bMM9Kj/Ve94pUrDK7MXgyql2BYOnocSXZIFjCd0e7skl76AkaWMx1LTC0+DKoSbHsKSM 67cg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737094602; x=1737699402; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ysqHYEjVA5Jdp2++CgG77DbXpuqMsg5Dhjh+TNPFaO0=; b=mSVPrAuWzELkjdLivTys8Rqy2CmpeICx/8cmpvxVYB3uvoWsa71r0keTcl8cDXwydv +vfoYnPw049ewgzmaJQSH9i9O6d9k8rDazKYt7iWqiLNgqBqGJ5QErA6VKJChcnqLbh2 r0lccrnl85gvhP3uqosXVBL9GGYsuzva2v+5w4hO60tq0DYytUvxpIysICLTgWZJFFk1 dAhWaqM9EuiyEahJMdauWy+t7E7k2D8xeMPwl1bhPENKXcWIJwNuIopXanKrngIxx23w Uxxt2s9wYXp/gpt91St01hLicqVAlTFWdhtL9JVEBR35A4+D4SIhBiGSjzBVAowD96Lm 5SMQ== X-Gm-Message-State: AOJu0YzC/RK6XNvzjsP66ThG+EGpE9rPXJWDA/610JeenxpXajYGNvBF QAUXwZ76ZPbIHh8Aw66H3GKyy+CHshf3BkR19OKvlxlJfjl+cTKe2gWTDFl9k96TeF6hlhA45oF BzB47cfO3siiIoIyPLSGQr+3RYIot0w== X-Gm-Gg: ASbGnct5k7UHbu561xACh31gFWMokeZUA6c0cr0vqDQjvIS6XmpUxep4e/La5a6GADW o2/K9FeP9WGM7eYKBK9HBbM2WRsUW0slX095Ptw== X-Google-Smtp-Source: AGHT+IHajJiFRhIjXNoawhka++z4GDefqHnWr1odkz6fi505gBU6cSXAwAfJIbNc/P8PQYDTyp+rcCflRvBwS6EtXWk= X-Received: by 2002:a05:6402:40d5:b0:5d9:d58:bcfa with SMTP id 4fb4d7f45d1cf-5db7db2a478mr3382186a12.27.1737094602407; Thu, 16 Jan 2025 22:16:42 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Siraj G Date: Fri, 17 Jan 2025 11:46:30 +0530 X-Gm-Features: AbW1kvb4LDY_jpgvRudOZbY0voOGht88FIfECraSJ_k56wzMtJspzYT-y7csKgw Message-ID: Subject: Re: vacuuming taking long time for pg_attribute To: Pgsql-admin Content-Type: multipart/alternative; boundary="000000000000b7c614062be0dab5" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000b7c614062be0dab5 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable One other thing I would like to add.. While the performance was problem, our application jobs also failed and we were unable to start them as internally they query pg_attribute. Regards Siraj On Fri, Jan 17, 2025 at 11:45=E2=80=AFAM Siraj G wrot= e: > Hello Experts! > > The PgSQL version is 16 and it runs in Cloud SQL managed by GCP. > > Problem was that we were unable to conveniently get the object details in > the schema browser (within the Cloud SQL Studio) as it was getting timeou= t > again and again. Several application jobs start to fail. Eventually we > found that pg_catalog.pg_attribute was having tons of dead tuples. While > vacuum on this took several hours, the problem got resolved eventually. > Command ran: vacuum pg_attribute; > > I would like to understand how this issue can be prevented. We do have > autovacuum ON and I could see the last vacuum on this table was just abou= t > 30hrs back. > > Appreciate any suggestions. > > Regards > Siraj > --000000000000b7c614062be0dab5 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
One other thing I would like to add..
While the perfor= mance was problem, our application jobs also failed and we were unable to s= tart them as internally they query pg_attribute.

R= egards
Siraj

On Fri, Jan 17, 2025 at 1= 1:45=E2=80=AFAM Siraj G <tosiraj.= g@gmail.com> wrote:
Hello Experts!

<= div>The PgSQL version is 16 and it runs in Cloud SQL managed by GCP.
<= div>
Problem was that we were unable to conveniently=C2=A0get= the object details in the schema browser (within the Cloud SQL Studio) as = it was getting timeout again and again. Several application jobs start to f= ail. Eventually we found that pg_catalog.pg_attribute was having tons of de= ad tuples. While vacuum on this took several hours, the problem got resolve= d eventually.
Command ran: vacuum pg_attribute;

I would like to understand how this issue can be prevented. We do h= ave autovacuum ON and I could see the last vacuum on this table was just ab= out 30hrs back.=C2=A0

Appreciate any suggestions.<= /div>

Regards
Siraj
--000000000000b7c614062be0dab5--