Re: Problem with estimating pages for a table

From: Dimitri Fontaine <dfontaine(at)hi-media(dot)com>
To: cristina(dot)maier(at)yahoo(dot)com
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Problem with estimating pages for a table
Date: 2009-05-14 10:35:00
Message-ID: 87octw9dm3.fsf@hi-media-techno.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

Cristina M <cristina(dot)maier(at)yahoo(dot)com> writes:
> For each varchar column - I add an extra 4 bytes
> For each numeric column - I add an extra 8 bytes
> Add a 28 bytes row overhead.
>
> For example if i have a table with col1: integer, col2: varchar, col3 varchar, I will get:
> pages = (col1width + col2width + 4 + col3width + 4 + 28)* no. of rows
> / block size

You may find Greg Startk's presentation on the topic helpful:
http://wiki.postgresql.org/wiki/Image:How_Long_Is_a_String.pdf

Regards,
--
dim

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2009-05-14 11:16:51 Re: Synchronous replication: Promotion of Standby to Primary
Previous Message Fujii Masao 2009-05-14 10:24:58 Re: New trigger option of pg_standby