Re: Looking find the each row size of table

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: dbatoCloud Solution <dbatocloud17(at)gmail(dot)com>, pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: Re: Looking find the each row size of table
Date: 2021-02-19 13:18:05
Message-ID: e4f7c01b5bc0daf5e2481d68ff5c2ab83314401c.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

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

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message James B. Byrne 2021-02-19 18:22:13 --locale options not honoured?
Previous Message John Scalia 2021-02-19 12:36:07 Re: Looking find the each row size of table