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 1tux2w-00Eq4q-Uj for pgsql-general@arkaria.postgresql.org; Wed, 19 Mar 2025 17:17:39 +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 1tux2v-008Pd0-L1 for pgsql-general@arkaria.postgresql.org; Wed, 19 Mar 2025 17:17:37 +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 1tux2v-008PcS-9f for pgsql-general@lists.postgresql.org; Wed, 19 Mar 2025 17:17:37 +0000 Received: from mail-yw1-x112d.google.com ([2607:f8b0:4864:20::112d]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tux2t-003jeT-1L for pgsql-general@lists.postgresql.org; Wed, 19 Mar 2025 17:17:36 +0000 Received: by mail-yw1-x112d.google.com with SMTP id 00721157ae682-6f47ed1f40dso55619437b3.1 for ; Wed, 19 Mar 2025 10:17:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1742404655; x=1743009455; 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=1eS+bUEC4T7XE5QqtgMI2Un4OklMh7FuhSSFBsSkp8c=; b=lVG4QjFUwnaR6x/WQco9U/nt1/LuNMjEI7MBaFLQzPbFMNVQF3igZgCwcenBjNqj97 AgY0XjihumAddMmDGnUFi4ikUmvo5lC07eVlO6861pc2yhNregqQe7xlvG8hMK1aB9Sv ke5D968eOo+fPh3CzDLAEXSDFKHiMZGt0iSw3753/JvQOOoP1BJUb94Qid92r2KGIQYk TSuJzWDWp6K1nE2Jv1ZVXS3iGE3MLikt+OU5SuM+w4RnAYxUBJruqbGRQZovNw2FJYwb 8oWslhE6DU1+ou4btL+tFJ2IBwWF878pjOZ2pqDFpN14JdnG0p5eWyIVKoS728706rgC bL1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742404655; x=1743009455; h=cc: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=1eS+bUEC4T7XE5QqtgMI2Un4OklMh7FuhSSFBsSkp8c=; b=kymYhW2dmTDj5TNG7dKyLjuJUbZRkubVFARyRTo+S/vERnnh3mmGsUF42Kl7RVKr1F +o6M3Ozsf/yfo+g4lSDzlZmFI4GvMXYBbNMdm0OMbTsqHPhc0ai3YPJdFIKybHbx3FpV iGgmiVugK79PTwnpGkOTQSyF5JqIVxtDbjkqcNs1P2TfTr5wACrH1ua0PM7M5omIyTJG 2Fqx3giy20gI+hPFs7q6P0Qq/hvbfIRW4orMJDXDPLdzSC4l65YzP0j4hlVTzBmwB9Mw rzsU+5F0Bfh4vJcBH0Kov9C4Wuz3O8p2zL5pX0Zu42cfIgp3YDehBXwV08zkkFsR1gbN 2teg== X-Forwarded-Encrypted: i=1; AJvYcCWF3xgkP0qvXCeOL0RxE2NgDPsJ6ee2NqQUQ0IVz8ZevJy9llgp8UySsfGnN4z0CmVxYFBn/WjTBpFC/YBs@lists.postgresql.org X-Gm-Message-State: AOJu0YzZdK1VA3wcq+e549Ieuyt4NQPg2pS2qBClkAPAv/dX3+kjc7Wf p42At/VvPRZtWm0G9aihJfsCAnIsws7n/olW08lIuygF81O5oU24Vymp+OH4P2CKifO5m5AeS0K WJA5dPfe+wEjB2gsDpHbt1ZIbU5YDzQ== X-Gm-Gg: ASbGncv/ZegF+EM2JZ/Pk4CMo6xNJ8d/8DEU20KkGKvoKpGlx1+S8xyLqXxiuVuSi58 xLCSFm4v+V+RI8cwmYkJG6JeyCUWoFNIe6uXMqQQSStB6cbqemmCsdooc1NO5Ok+jBtasnN/KBX h7Z8XBvwuDIxQEiJgX+H6COBbzB9Ozc+HM5kbXDqEm/yfgSOGuw77My2wSs4Q= X-Google-Smtp-Source: AGHT+IFMSME5/GGO+aKYNFEbhA2URGaz4PHOCGu26or7rVPUX9XDHd6ebfbXibFK7kCqx9KQs2BTCqicDl/mOwLBAQc= X-Received: by 2002:a05:690c:7281:b0:6ef:77e3:efe6 with SMTP id 00721157ae682-7009bf7f581mr55071537b3.13.1742404654674; Wed, 19 Mar 2025 10:17:34 -0700 (PDT) MIME-Version: 1.0 References: <202503191713.6pezw2uqo2c3@alvherre.pgsql> In-Reply-To: <202503191713.6pezw2uqo2c3@alvherre.pgsql> From: Pavel Stehule Date: Wed, 19 Mar 2025 18:16:57 +0100 X-Gm-Features: AQ5f1Jr6PmQDPm8ys9qAQRctdJ5FglRqofoDIxt40YB0rp3-BS8YN29mZW8BMfM Message-ID: Subject: Re: size of attributes table is too big To: =?UTF-8?Q?=C3=81lvaro_Herrera?= Cc: Siraj G , pgsql-general@lists.postgresql.org Content-Type: multipart/alternative; boundary="0000000000007f3e260630b53274" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000007f3e260630b53274 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable st 19. 3. 2025 v 18:14 odes=C3=ADlatel =C3=81lvaro Herrera napsal: > Hello > > On 2025-Mar-19, Siraj G wrote: > > > I have a PG (v16) instance which is occupying around 1TB of storage. Ou= t > of > > this, around 350GB is occupied by the table pg_catalog.pg_attribute. > > Why is the catalog table's size so big? > > Heavy use of temp tables is a known cause of this. > > > I think this table must have tons of dead tuples. Please suggest to me = if > > we can purge any data/shrink the size of this table. > > Yeah, I'd also bet that there are tons of dead tuples, or just unused > free space. To purge it you would use VACUUM FULL, though that would > need to lock all accesses to the table. > > Does your instance run with autovacuum disabled perchance? > or long unclosed transactions, maybe forgotten replication slots, ... It is very strange so with this size it is still usable. Today hardware is unbelievable strong Regards Pavel > > -- > =C3=81lvaro Herrera PostgreSQL Developer =E2=80=94 > https://www.EnterpriseDB.com/ > Bob [Floyd] used to say that he was planning to get a Ph.D. by the "green > stamp method," namely by saving envelopes addressed to him as 'Dr. Floyd'= . > After collecting 500 such letters, he mused, a university somewhere in > Arizona would probably grant him a degree. (Don Knuth) > > > --0000000000007f3e260630b53274 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


st 19. 3. 2025 = v=C2=A018:14 odes=C3=ADlatel =C3=81lvaro Herrera <alvherre@alvh.no-ip.org> napsal:
Hello

On 2025-Mar-19, Siraj G wrote:

> I have a PG (v16) instance which is occupying around 1TB of storage. O= ut of
> this, around 350GB is occupied by the table pg_catalog.pg_attribute. > Why is the catalog table's size so big?

Heavy use of temp tables is a known cause of this.

> I think this table must have tons of dead tuples. Please suggest to me= if
> we can purge any data/shrink the size of this table.

Yeah, I'd also bet that there are tons of dead tuples, or just unused free space.=C2=A0 To purge it you would use VACUUM FULL, though that would<= br> need to lock all accesses to the table.

Does your instance run with autovacuum disabled perchance?
=

or long unclosed transactions, maybe forgotten replicat= ion slots, ...

It is very strange so with this siz= e it is still usable. Today hardware is unbelievable strong

<= /div>
Regards

Pavel
=C2=A0
<= /div>

--
=C3=81lvaro Herrera=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0PostgreSQL Developer= =C2=A0 =E2=80=94=C2=A0 https://www.EnterpriseDB.com/
Bob [Floyd] used to say that he was planning to get a Ph.D. by the "gr= een
stamp method," namely by saving envelopes addressed to him as 'Dr.= Floyd'.
After collecting 500 such letters, he mused, a university somewhere in
Arizona would probably grant him a degree.=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 (Don Knuth)


--0000000000007f3e260630b53274--