Re: Problem with estimating pages for a table - Mailing list pgsql-hackers

From Dimitri Fontaine
Subject Re: Problem with estimating pages for a table
Date
Msg-id 87octw9dm3.fsf@hi-media-techno.com
Whole thread Raw
In response to Problem with estimating pages for a table  (Cristina M <cristina.maier@yahoo.com>)
List pgsql-hackers
Hi,

Cristina M <cristina.maier@yahoo.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


pgsql-hackers by date:

Previous
From: Fujii Masao
Date:
Subject: Re: New trigger option of pg_standby
Next
From: Fujii Masao
Date:
Subject: Re: Synchronous replication: Promotion of Standby to Primary