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 1sTNat-00Fe72-J7 for pgsql-general@arkaria.postgresql.org; Mon, 15 Jul 2024 15:26:27 +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 1sTNas-00B1bN-AD for pgsql-general@arkaria.postgresql.org; Mon, 15 Jul 2024 15:26:26 +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 1sTNar-00B1bF-QQ for pgsql-general@lists.postgresql.org; Mon, 15 Jul 2024 15:26:25 +0000 Received: from mail-lj1-x22b.google.com ([2a00:1450:4864:20::22b]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sTNao-002Fst-Og for pgsql-general@lists.postgresql.org; Mon, 15 Jul 2024 15:26:25 +0000 Received: by mail-lj1-x22b.google.com with SMTP id 38308e7fff4ca-2ebe40673e8so59551541fa.3 for ; Mon, 15 Jul 2024 08:26:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bitnine-net.20230601.gappssmtp.com; s=20230601; t=1721057180; x=1721661980; 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=JWi8jxUNzl3RtfTSZFJvzWaIfeur1/qqLGmQgWPIJ4Y=; b=VeiIkIODOAfM+BJkLbhBYwkPoKsp7JT+Vf/5NEGZFDkzgE8r5jXu7OmRuoDqQcHfKH Q8aRZwN873bjTV4fBVbXkvlVqO6L5Q4E4oYTdr8tlevOwQPMU6bbyuECZWeRrjQzgDZG sDnXZpP5RjfqJt+LcubilOpn3MRo63PQH3Im0C8z3t1C4kO0PTBGksEvO813lsS/5Jkn v3LBPoqsss4d/jdKcBKSzPpPV3UMa2jBNxVEOw3GxKPVuXRB7gW8Efq46H4DJnt+mdtq BAWn0E+ASCINIzKJkVEIvXFFG49CipYAHvjlrxGVh3FzxN5W6aVqy3HpEK2aF1aMKFpM qUQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721057180; x=1721661980; 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=JWi8jxUNzl3RtfTSZFJvzWaIfeur1/qqLGmQgWPIJ4Y=; b=c7rb5ZYypLQWKnbcmmZKZtlfGw7RPQQCgB1mtpnCRNtbx24z3u04598w/PV9Hf/UIf K3O30WSat21eUaLmd9o/RCpZLpqaVuT4X9Tms9bRCBXNuSFSpSaryjW8+O6ELIy/2ajy X32b0S3qdgyLnjSS+ogvnkcG/RtkrQXMJTrnIcjFokfhzA6vcPy8EsPXlQJh2HjDStWH UL4aYVedXZuJ9L3XF0sl0948rGo/x9lu2c8Qvr1RF8bPjAEJyWib7UvlxDrVo3coOhI5 zKZZCCDOh0qLiPNjlvtOjzyGPVdo+odnJn71I0nypD+9P3TADoz3MJNoA5EVLLlNBQr9 ZTLw== X-Gm-Message-State: AOJu0YxSBjVsUyd2WueH4ROf0b9feBBzjyLN+pLhuRjGOFKgLUfBW0/g OZhkquCcvJF4XGOFMfjZqce0uoGhZgqJxe3wwxRT6lo5x4CngfOAl4Uwwaq8WtITnh8V1hS5MzA AcnPXnXNlHOvetWBkng5+MAkQL5xH4MThitPajg== X-Google-Smtp-Source: AGHT+IH+YOEwVtUWnwcbb1QpzKaXNxGf93idkaxNaz94GCtEP/I7hH6gGufbdXR4TlQeQz3RODtzd6rq4MyoWaoMzLY= X-Received: by 2002:a2e:9606:0:b0:2ee:44f7:cc74 with SMTP id 38308e7fff4ca-2eef2d5faf8mr1728151fa.6.1721057179915; Mon, 15 Jul 2024 08:26:19 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Muhammad Imtiaz Date: Mon, 15 Jul 2024 20:26:07 +0500 Message-ID: Subject: Re: Monitoring DB size To: "Shenavai, Manuel" Cc: pgsql-general@lists.postgresql.org Content-Type: multipart/alternative; boundary="000000000000d8f25d061d4ad961" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000d8f25d061d4ad961 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, You can choose from the following options. Hopefully, they will meet your requirements 1) pg_stat_user_tables view 2) pgstattuple extension Regards, Muhammad imtiaz On Mon, 15 Jul 2024, 19:42 Shenavai, Manuel, wrote: > Hi everyone, > > > > we currently capture the db size (pg_database_size) which gives the =E2= =80=9CDisk > space used by the database with the specified name=E2=80=9D. Is it possib= le to > further split this data how much space is occupied by live tuples, dead > tuples and free space? > > > > We would like to have something like: > > DB Size: 200 MB, live tuple 100MB, Dead Tuple: 20 MB, free space 80MB > > > > Is this possible? > > > > Best regards, > > Manuel > --000000000000d8f25d061d4ad961 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi,

You can = choose from the following options. Hopefully, they will meet your requireme= nts

1) pg_stat_user_tabl= es view
2) pgstattuple extension

Regards,
Muhammad imtiaz

On Mon, 15 Jul 2024, 19:42 Sh= enavai, Manuel, <manuel.shena= vai@sap.com> wrote:

Hi everyone,

=C2=A0

we currently capture the db siz= e (pg_database_size) which gives the =E2=80=9CDisk space used by the databa= se with the specified name=E2=80=9D. Is it possible to further split this d= ata how much space is occupied by live tuples, dead tuples and free space?

=C2=A0

We would like to have something= like:

DB Size: 200 MB, live tuple 100= MB, Dead Tuple: 20 MB, free space 80MB

=C2=A0

Is this possible?=

=C2=A0

Best regards,

Manuel

--000000000000d8f25d061d4ad961--