Skip site navigation (1) Skip section navigation (2)

Re: determining maxsize for character varying

From: Ragnar <gnari(at)hive(dot)is>
To: okparanoid(at)free(dot)fr
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: determining maxsize for character varying
Date: 2007-06-16 12:30:20
Message-ID: 1181997020.5953.170.camel@localhost.localdomain (view raw or flat)
Thread:
Lists: pgsql-performance
On lau, 2007-06-16 at 13:35 +0200, okparanoid(at)free(dot)fr wrote:
> Thanks
> 
> if i understand well that means that if i choose character varying(3) or
> character varying(8) or character varying(32) or character varying with no max
> length the fields will take the same place in the disk (8kb) except for fields
> too long to take place in the 8kb whose are stored in another place ?
> 
> Is that correct ?

not at all

a varchar will occupy the bytelength of your actual string,
+ a small fixed overhead+padding, except when the total rowsize causes
TOASTing

in single-byte encodings, the string 'okparanoid' will occupy
the same amount of diskspace in a varchar, varchar(10) or a
varchar(1000) column, namely around 16 bytes.

hope this helps

gnari



In response to

pgsql-performance by date

Next:From: Tom LaneDate: 2007-06-16 15:07:08
Subject: Re: determining maxsize for character varying
Previous:From: okparanoidDate: 2007-06-16 11:35:09
Subject: Re: determining maxsize for character varying

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group