pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: dbatoCloud Solution <dbatocloud17@gmail.com>
To: pgsql-admin@lists.postgresql.org
Subject: Re: Looking find the each row size of table
Date: Fri, 19 Feb 2021 14:18:05 +0100
Message-ID: <e4f7c01b5bc0daf5e2481d68ff5c2ab83314401c.camel@cybertec.at> (raw)
In-Reply-To: <CAEz7P_s44M2u4bL5ebEdY3v+K3YdUqrG67PQ5U_PasGLH2vhgA@mail.gmail.com>
References: <CAEz7P_s44M2u4bL5ebEdY3v+K3YdUqrG67PQ5U_PasGLH2vhgA@mail.gmail.com>

On Fri, 2021-02-19 at 17:58 +0530, dbatoCloud Solution wrote:
> I want to find out each row size of a table in PostgreSQL? 
> I got pg_column_size() function. Could you please someone help me? Will this function return size in KB or MB?

If your table rows are several KB in size, you may have a problem.
pg_column_size() measures the size in bytes.

In my experience the best measure is to create a table, fill it with some 10000
rows and divide the table size by the row count.
There is substantial overhead for each row, and there will be overhead and
fragmentation on the block level too.

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com






view thread (4+ messages)  latest in thread

Message-ID: <e4f7c01b5bc0daf5e2481d68ff5c2ab83314401c.camel@cybertec.at>
Permalink:  ../e4f7c01b5bc0daf5e2481d68ff5c2ab83314401c.camel@cybertec.at/
Also on:    postgresql.org/message-id/e4f7c01b5bc0daf5e2481d68ff5c2ab83314401c.camel@cybertec.at

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: laurenz.albe@cybertec.at, dbatocloud17@gmail.com, pgsql-admin@lists.postgresql.org
  Subject: Re: Looking find the each row size of table
  In-Reply-To: <e4f7c01b5bc0daf5e2481d68ff5c2ab83314401c.camel@cybertec.at>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox