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 1wYIVD-000AtO-17 for pgsql-admin@arkaria.postgresql.org; Sat, 13 Jun 2026 07:09:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wYIVA-002vCt-1y for pgsql-admin@arkaria.postgresql.org; Sat, 13 Jun 2026 07:09:56 +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 1wYIV9-002vCS-2u for pgsql-admin@lists.postgresql.org; Sat, 13 Jun 2026 07:09:56 +0000 Received: from mail-qk1-x730.google.com ([2607:f8b0:4864:20::730]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wYIV6-000000007qA-1cgB for pgsql-admin@lists.postgresql.org; Sat, 13 Jun 2026 07:09:52 +0000 Received: by mail-qk1-x730.google.com with SMTP id af79cd13be357-915d17e2721so230709685a.3 for ; Sat, 13 Jun 2026 00:09:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1781334590; cv=none; d=google.com; s=arc-20240605; b=D1ivZ77T8K4SgXfDhcRYp9E0TakBYRpYKqkHnZH974c+5SfmUNKK4it7HgsNIUOhSE qA28XAuPzshR6kWLq82G6NOojsBmAQJsaHbz//rBrahQigj0PGUNFMBhc5ftMAw8kob5 nHTGIv7P2fXYgkVMx80I3UZc+1pZAjEsWnOveUaD+UFobqfz66MEpx6W2EQNd/rtR8XV rnyDgKscu0ybZl3iYF1zcFn4YcBATqoO4NlCtLHz8HPzAwo+q8ucmKio1RxD7EFRzPV2 s7qYXmUBtyl9dznwxoF45aUoqQmVsLpfdK0NRU0EiYsEeXnDSCJg6o/9sRJP6H4IRTwe 7EGg== 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=ucX0lOUL0tz1brbR9IRsBQA445nUrAnWeVYasS2hx44=; fh=wdXGVzlufEJVTc6wMaMv0VsO7oswMxTqQBT0LXOkQhg=; b=GLSDwoF9Vzu/x0WGzH/S1tgz15rbwkVmeAaywl/4zzsPYqlM7JqD7hrTpdJpvWReAD dhK61BGT95DCrTt+GG8gi6k5W/SqCGyNaIukS06gbqM44byp6hGOUwGBQpEXd9L4Z8Th 84U4kVI4NAr2QS0maSWpnro6pRLMZwfxrBnJCTyuLKwfdWoJt50TpwrYdg9tnogeMwHi 0vGCe3BshpYstFokzVxHNZbVn365ap4/f8d/GszU/8v96E6cpFtUo7GNkesT0Youlays rR0ksl2Mj7aFun4kx2iNn/CcmomO2W+9/4W1Pfm+FAjcvyDpduyRrG781G5t/BqhKPFe y0kw==; 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=1781334590; x=1781939390; 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=ucX0lOUL0tz1brbR9IRsBQA445nUrAnWeVYasS2hx44=; b=Ordi6nTjeNPMb1pTZFxpLsYtVPVQW1oJneXR23G8ouvpN3Hf15Y/jKV/hYSfRjJpSg ho/a/p/atEXtQTMhS5RuGqbVcqcIOd2rvsGLt8YR6cwVHmlgL8XEjgZ9//IsXNsqZEj6 BqxR7/kGvppR9I37Hu6HuY8phWA8rFB/AIefafBwZA/941dUJJNk6PXuv4srFEJbRA0Q LQAsDo4JRn6McJV25mLmonAQ8NaDvff9mV/A7LXV5/0od0SZxdf0fd8ToSDsspYirACb h25hbRrAeIQHTU2KmZvOtHymRQLAOJTIOvLDQFuzZJwpUCO+UfzjL8qvwhicbS6Lb+Bu nmDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781334590; x=1781939390; 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=ucX0lOUL0tz1brbR9IRsBQA445nUrAnWeVYasS2hx44=; b=tM82JTyKW02DT7W52UdOun5OkVEiAvxufWVKMP4wwSiO8pHqcLGWqWngcSNhUwI2pC BOR5Pr5uGqF05woZp2/4ruZObcXcpSMBoGtfd4+1dAAUeIPeTaOdiIbgbnvTuoWbuTCg 4lZgq+NP8mrIVQ6yY/OaFP6vi9whxnvYTAeTDlIaT6AwdzCYWNdjNrTB0piQPHPQOtxk agMN2GRnroCCIxqfM4lQfYdytThMcYyhSdypyOqOmTvwJdnBMp2O33pzIJQ1eE5uSolA H9ZCVx3qSr8n0UhwE5JK9xoB6ZEainAAIJzJNcf4ux2Sqq662CnWANCqo+DP3uWNPvMg bOIQ== X-Gm-Message-State: AOJu0Yw30xyakI3KWE4Od+E8w9P5kXZrwcKaNb8bUdopoWrNYAwBXDGj 5pDSmY7G8RLR2lvcgZ9e1Lo5EsZAGCxkcailyYroL6dYmF7zQRD0K0/2SGgVsclzDxIwmyuA1hF oSswESaDmFRLqJyDjfoHJreYYfR6BHTw= X-Gm-Gg: Acq92OGiF5AuIBO1s499iA6Tgjdrb2k7OQ3rt2qu+ca6RDki1dcoDEjMyjoT7hRm6gy XOeznJlArsldajuEOdM1trG1Wr/wmJQreN8sHvsUv49QWY5DfOaw1VMrF5rXzi+iqKmiL/+xO9l OZTT4107bJ8+Kpem+BusYHhIrK8AduQ+B4JWqtG3Uyc4f7ryTjU1j8qBdW2znL8lnAKYn2ktAVc EFOsZpTS627IUmuCEfp4FY4MORUlcZUHKhV4qFpdbG/DxdwdsFM0FpQ7J1FJFjlulBb5wyjy1ad dJssvhWy5MhfWYlkrq4sSVdivL0FHjodxAIGLPID X-Received: by 2002:a05:620a:31a5:b0:915:aad5:e962 with SMTP id af79cd13be357-917f069e1bcmr444596285a.19.1781334590086; Sat, 13 Jun 2026 00:09:50 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Bhanu Prakash Date: Sat, 13 Jun 2026 12:39:38 +0530 X-Gm-Features: AVVi8CdlPUU-LYG7d1nawvoB7Wq1wH2nj7djG_E_6tGZHXuE7Qe-btteZ6hc-_Q Message-ID: Subject: Re: Size of /pgdata To: Raj Cc: Pgsql-admin Content-Type: multipart/alternative; boundary="00000000000077e25606541d4722" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --00000000000077e25606541d4722 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Probably, pgsql_tmp file might consumed rest of ~200gb disk. You will find 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 ar= e > 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 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 327683* and able to find t= he > total size the files occpuing and found 113gb.......so for one table itse= lf > it is 40Gb additional... > > I also checked the bloat of table using pgstatstuple and no bloat observe= d > for this sample table > > Why we have so much increase of file size? How we can avoid or tune it? I= s > it about reallocating files and not being used fully? What's the solution= ? > > > > > --00000000000077e25606541d4722 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Probably, pgsql_tmp file might consumed rest of ~200gb di= sk. You will find this inside base directory.=C2=A0
=
During large query executions, if data to be so= rted exceeds work_mem settings, postgresql creates temporary files and spil= ls data to disk.=C2=A0

P= ossible reasons :=C2=A0
Poor query
Large batch jobs
Missing index
LRQ=E2=80=99s
Too low work_mem
<= br>
On Sat, 13 Jun 2026 at 12:18=E2=80=AFPM, Raj <rajeshkumar.dba09@gmail.com> wr= ote:
Hi all,

I am using 17.9= version.=C2=A0

I see su= ddenly 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. Ignor= ing postgres and template dbs as they are in KBs.
Now where the remaining 300 comes from approximat= ely..?

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=C2=A0 approximately don't know where it comes from.

So du -sh /base is approximately= 830Gb whereas 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 siz= e du -sh 327683*=C2=A0 and able to find the total size the files occpuing a= nd found 113gb.......so for one table itself it is 40Gb additional...
=

I also checked the bloat of t= able using pgstatstuple and no bloat observed for this sample table=C2=A0

Why we have so much incre= ase of file size? How we can avoid or tune it? Is it about reallocating fil= es and not being used fully? What's the solution?




--00000000000077e25606541d4722--