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 1wYIWG-000AuN-2M for pgsql-admin@arkaria.postgresql.org; Sat, 13 Jun 2026 07:11:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wYIWF-002yaq-29 for pgsql-admin@arkaria.postgresql.org; Sat, 13 Jun 2026 07:11:03 +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.96) (envelope-from ) id 1wYIWF-002yah-0z for pgsql-admin@lists.postgresql.org; Sat, 13 Jun 2026 07:11:03 +0000 Received: from mail-lf1-x12c.google.com ([2a00:1450:4864:20::12c]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wYIWD-0000000090X-12Vg for pgsql-admin@lists.postgresql.org; Sat, 13 Jun 2026 07:11:03 +0000 Received: by mail-lf1-x12c.google.com with SMTP id 2adb3069b0e04-5aa68cd8dd3so1563178e87.0 for ; Sat, 13 Jun 2026 00:11:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1781334660; cv=none; d=google.com; s=arc-20240605; b=UieTPTdbiojT1/9mQR67jW9h9DpJ7g06xZd3QaCrgnkyW5TdbQOZGnFUmufLHQwyYd VfwQ3tVH4UOgkrkLnhz4N5CSLFtTlv83SRgZR7xNLTsLipB98Iti6eeSpWEreksAAb94 6m1OSK48OJ3xu9CmpwF6LlMgRrzqtfyJN2bIn3dL05bhJzn0hMQ4+OV9nHkU+TmkHXP3 x5Ba+FKDaKw3Dt/kx5E2w3UNPs9EGXDieXAG5r/eLNwrocBmjnrEOHpV4rFSOpcT1kQK j3jeBs1twg/x9mrxCrV9weLYawU7UgC7LTBdATgXb6/x1l2XDl8BPI3uhHunB9c/BZ/O jPWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=/8pUq1NnOvgps2tu7y4tK1PUBx6vXn1ZPA8XT+vSfyM=; fh=mL4mDZRxOS+wDBzR2RPLXB840mh/Zi2JNpiRkIG7cpc=; b=bAEkDOfoG5bsG+v5hkde3AFbkHlVGEvD+DER9yzkZFnzdJO/IAT/mcmjuL8oaUwOM/ VSW5CU458RmU52dN3pGl0rR4DP8Uaj+5gecQkUA3iAXau5qo/uXna7R5164ZoJBzdTEq hphsa5h7J+Q1fUjrvVtr+png8wCemYU1zQVqBstdasvU5lKGqKPGIvPihTR/bNx22fVz QX+ilLIl8VzDXDf6+UtOlD2exDaMCbzn00Wy9Z5XV0cXfc7Cno/W+CYheqhsF5V+d8G6 rE5AtMzzXdx40zT2vj7d3ia0OGCfv7ap7Pze4w61a7rar8H4wMhLVNodBoqiBjOsGNoU /WNg==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1781334660; x=1781939460; 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=/8pUq1NnOvgps2tu7y4tK1PUBx6vXn1ZPA8XT+vSfyM=; b=d9Z6rmpdpqtRa9QDcBzRBNVhDg5KjALmNKN61n/OM9IJxsLMoVam1bOzf8O3Lkc3dn 0E+hRYS5JASngRg+oGDOfDB1HrqAQ8Fl7zyZ1pI24CpGEyMLkOWrlrgo2OOP4K8VFTG1 dZPXETdYyy99C02VQKZkBEE9Vh/vZh7R3K8mpxreGSCcH+iPrkIisjzH5NBPykhHl/CB ZZLjcCHEH/Sb0t8fLvVlky4DiDGFOwkoPNqN1m+CFvKhh587CSyaepdUKpFb+c+uGhG7 yQd4nGId1q2LS4Od0P37uIO5qswAMz1RBBMut70OKTVE1+o883d7Kz3ZyrihtiXoaGDE IZpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781334660; x=1781939460; 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=/8pUq1NnOvgps2tu7y4tK1PUBx6vXn1ZPA8XT+vSfyM=; b=J/P9JKs3qo6tAhAYag7KEjg6xQk7AMZG5c2Zo7mkpflcdJhKAacM2UT0GqQ6pwP+RB 4vu68PtwJr8rYQHTWE1P/bPyt52/kkq/je5PYg2eOUbUva7lwK23jeRROmvlcJGtBXTm PnsEtw71uWjjIOhrp4Jo5mgKxryyZ5+EgT3w4+uKQ5fnsk3uf//XUwnpCyieRUgaAbAg y8yCfxK23uVNMuEE/Px4QkZvJNDRnFUVR2bBfyugCriLiCnP+Rr+CxoXQ5BrmVfaJVQ9 7Eh5+JJnYbLx3XXensGhlPritPr5rC6CFkpKXbZkdoY7ZrZcOkeEiv0mA4W/61z9u8lO 2xHA== X-Gm-Message-State: AOJu0Yylzf1Xibzu7NUZAfsvMmeKBDjOUwmDhNY4sHsaTrAi8GT+h9qm lmtRUU7J2zsPY7R68mF4xkUifR9qWl8e0WBhg2DnEv2P/LOmyC3Ek1Eool48mCMopQiDs8a/Gqz AyuBoNuCz/XlDfw4FJVeAz3J3f107c3ag4Q== X-Gm-Gg: Acq92OFOfeiYPqvBu+tvRTOM8qOEDqSY+D5UCUKcQLGZ33L8nwBjgn/uooQyps3Tt4a KUe15Co9216wkc/da6oMgC1PXmRPgkK+Q7goQ+LpEnGcZ4XinKoXFm0RWKEGcCA9vh4vvM8MZyo fZHD5OnVo3N8I9hPm2geRe4TixG+bwhYW83UorME6d2dABnp3mLSlrIVo3BL9FuLU/gvyOAzfd7 4ZYYSZnvCxFA+P8LJPTngKpfqdQcMwadsZ923LVS3ITKhUJ2nok9E8bdUaW/7ootwcNSoYO4n45 ggfJf6HB3aKxQLn1JhFoAVUh4lyiSK+83zfHsl9gGA== X-Received: by 2002:ac2:5293:0:b0:5aa:659b:2a96 with SMTP id 2adb3069b0e04-5ad2db58f0cmr1292535e87.23.1781334659662; Sat, 13 Jun 2026 00:10:59 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Raj Date: Sat, 13 Jun 2026 12:40:48 +0530 X-Gm-Features: AVVi8CdZvr2SzckPyOehsRvK3yisJWCMlRskqnxoOJyWD-osX5StGIKbQFPlU-E Message-ID: Subject: Re: Size of /pgdata To: Bhanu Prakash Cc: Pgsql-admin Content-Type: multipart/alternative; boundary="0000000000009d879706541d4ba7" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000009d879706541d4ba7 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Checked temp files as well...no thesee are not temp.files On Sat, 13 Jun 2026, 12:39 Bhanu Prakash, wrote: > Probably, pgsql_tmp file might consumed rest of ~200gb disk. You will fin= d > this inside base directory. > > During large query executions, if data to be sorted exceeds work_mem > settings, postgresql creates temporary files and spills data to disk. > > Possible reasons : > Poor query > Large batch jobs > Missing index > LRQ=E2=80=99s > Too low work_mem > > On Sat, 13 Jun 2026 at 12:18=E2=80=AFPM, Raj wrote: > >> Hi all, >> >> I am using 17.9 version. >> >> I see suddenly du -sh /pgdata/17 shows 930GB. Total allocated is 1TB. >> >> I checked the db size using \l+ and also pg_total_relation_size and size >> for particular db is 630GB. Ignoring postgres and template dbs as they a= re >> in KBs. >> >> Now where the remaining 300 comes from approximately..? >> >> I checked pg_wal and is 100gb..that is intended based on max_wal_size >> setting. >> >> Postgres logs also in MBs ..so ruling out that. >> >> Now 300 - 100 =3D 200gb approximately don't know where it comes from. >> >> So du -sh /base is approximately 830Gb whereas actual db size is 630gb a= s >> mentioned earlier. >> >> I took one big sample table which is 73GB, and using relfilenode(327683) >> I tried finding the underlying file size du -sh 327683* and able to fin= d >> the total size the files occpuing and found 113gb.......so for one table >> itself it is 40Gb additional... >> >> I also checked the bloat of table using pgstatstuple and no bloat >> observed for this sample table >> >> Why we have so much increase of file size? How we can avoid or tune it? >> Is it about reallocating files and not being used fully? What's the >> solution? >> >> >> >> >> --0000000000009d879706541d4ba7 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Checked temp files as well...no thesee are not temp.files=

On Sat, 13 Jun 2026, 12:39 Bhanu Prakash, <mallelabhanuprakash@gmail.com= > wrote:
Proba= bly, pgsql_tmp file might consumed rest of ~200gb disk. You will find this = inside base directory.=C2=A0

During large query executions, if data to be sorted exceeds work_mem s= ettings, postgresql creates temporary files and spills data to disk.=C2=A0<= /div>

Possible reasons :=C2=A0=
Poor query
Large batch jobs<= /div>
Missing index
LRQ=E2=80=99s
Too low work_mem

On Sat, 13 Jun 2026 at 12:18=E2= =80=AFPM, Raj <rajeshkumar.dba09@gmail.com> wrote:
Hi = all,

I am using 17.9 version.= =C2=A0

I see suddenly du= -sh /pgdata/17 shows=C2=A0 930GB. Total allocated is 1TB.

I checked the db size using \l+ and also= pg_total_relation_size and size for particular db is 630GB. Ignoring postg= res and template dbs as they are in KBs.

<= div dir=3D"auto">Now where the remaining 300 comes from approximately..?

I checked pg_wal and is 10= 0gb..that is intended based on max_wal_size setting.

Postgres logs also in MBs ..so ruling out that= .

Now 300 - 100 =3D 200g= b=C2=A0 approximately don't know where it comes from.

So du -sh /base is approximately 830Gb wh= ereas actual db size is 630gb as mentioned earlier.
=
I took one big sample table which is 73GB, and = using relfilenode(327683) I tried finding the underlying file size du -sh 3= 27683*=C2=A0 and able to find the total size the files occpuing and found 1= 13gb.......so for one table itself it is 40Gb additional...

I also checked the bloat of table usi= ng pgstatstuple and no bloat observed for this sample table=C2=A0

Why we have so much increase of f= ile size? How we can avoid or tune it? Is it about reallocating files and n= ot being used fully? What's the solution?




--0000000000009d879706541d4ba7--