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 1tux2b-00Eq1c-2Q for pgsql-general@arkaria.postgresql.org; Wed, 19 Mar 2025 17:17:17 +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 1tux2Z-008Mhz-Ku for pgsql-general@arkaria.postgresql.org; Wed, 19 Mar 2025 17:17:15 +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 1tux2Z-008Mhl-A8 for pgsql-general@lists.postgresql.org; Wed, 19 Mar 2025 17:17:15 +0000 Received: from fout-a3-smtp.messagingengine.com ([103.168.172.146]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tux2X-003jdU-1Q for pgsql-general@lists.postgresql.org; Wed, 19 Mar 2025 17:17:14 +0000 Received: from phl-compute-03.internal (phl-compute-03.phl.internal [10.202.2.43]) by mailfout.phl.internal (Postfix) with ESMTP id 7BA481382CE9; Wed, 19 Mar 2025 13:17:12 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-03.internal (MEProxy); Wed, 19 Mar 2025 13:17:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1742404632; x=1742491032; bh=jITvROaRp1hqy8sJMaqagppUye3DYuq/zSNPvGGERE0=; b= X5uUhfeCAVCXMMhu78KAJ6MOSTSOSpiaxnbhaHaDWTEslXe164r6L58/mJsigpl/ r800FNSh1yXRFGDk0Y+cPmQjsbt7yN/qdEe1FXs2eygXvOImR4oisguxtsg7C75E /sdT1Sw/xsKd0HSsWfV3nb6fKxdjP3e4v3KlyrOo70FejAFRXGraRjl4OaPhCfjK lkce8vVDXA8KBu08rrwbH0BhCT0WjCm+pMdf8H+UcZ7+sTlQNOlwqEaCwcQxuMul NBhT0X3DHPEAoz/g4j9ZWHC5yw/Z6KvodmCmGtv5Tcicv34FrGlgBbhfxv34Pr57 7W2GAXSW9u8TqqS5ibcmxg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; t=1742404632; x=1742491032; bh=j ITvROaRp1hqy8sJMaqagppUye3DYuq/zSNPvGGERE0=; b=Mf9FS1jcmlz6Y6myU FKQyZrY5NQ2KjU12IeVm+RtmF+eTB4uTQus9gkMoEm4qUgyHyhqhC1mWVIWyE4bp uWZrc+YABSDAfpk5XpIBaGoW4fc+j8x5xsLA8FFHciKAAb57mmjz/XSFBX1sEQ42 tOh12qDaX/4oajCfk7UkhbRoSE/v7L2S7WCnIEn/MhNlBJzXR9ZydSzXP1CA5cui 5/v7r8QDE53JOMNbEivHN2X3V6vK4Er2IA4hp6OcRkA8rBWuCowDwXB47q2hE1Cq 76Z5W7sivocWWhZSJVrdKDrlBY1LHEDmmsMovmbNCGMVBA15/PhB2WtnqMBoNO2H YRVqg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddugeehleduucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpefkff ggfgfuvfhfhfgjtgfgsehtjeertddtvdejnecuhfhrohhmpeetughrihgrnhcumfhlrghv vghruceorggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomheqnecuggftrf grthhtvghrnhepiedvhfeiheehgeeuieeljeeitedtjeehudegfeelkedvleekhedtgfei ffefkedunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh eprggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomhdpnhgspghrtghpthht ohepvddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepthhoshhirhgrjhdrghesgh hmrghilhdrtghomhdprhgtphhtthhopehpghhsqhhlqdhgvghnvghrrghlsehlihhsthhs rdhpohhsthhgrhgvshhqlhdrohhrgh X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 19 Mar 2025 13:17:11 -0400 (EDT) Message-ID: Date: Wed, 19 Mar 2025 10:17:10 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: size of attributes table is too big To: Siraj G , pgsql-general@lists.postgresql.org References: Content-Language: en-US From: Adrian Klaver In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 3/19/25 10:06, Siraj G wrote: > Hello! > > I have a PG (v16) instance which is occupying around 1TB of storage. Out Exact version of Postgres 16, include the x in 16.x. > of this, around 350GB is occupied by the table pg_catalog.pg_attribute. > Why is the catalog table's size so big? > > Here are the sizes: How did you measure the sizes? pg_attribute maintains information about table columns, how many table columns do you have? Are you creating/dropping tables on a regular basis? Is autovacuum running properly? Have you run VACUUM manually on pg_attribute? > > pg_attribute > > 338 GB > pg_attribute_relid_attnam_index > > 117 GB > pg_attribute_relid_attnum_index > > 69 GB > > > 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. > > REgards > Siraj -- Adrian Klaver adrian.klaver@aklaver.com