pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ragnar <gnari@hive.is>
To: okparanoid@free.fr
Cc: pgsql-performance@postgresql.org
Subject: Re: determining maxsize for character varying
Date: Sat, 16 Jun 2007 12:30:20 +0000
Message-ID: <1181997020.5953.170.camel@localhost.localdomain> (raw)
In-Reply-To: <1181993709.4673caedd6fe8@imp.free.fr>
References: <1181987590.4673b306d4baf@imp.free.fr>
	<20070616105525.GA13754@KanotixBox>
	<1181993709.4673caedd6fe8@imp.free.fr>

On lau, 2007-06-16 at 13:35 +0200, okparanoid@free.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





view thread (5+ messages)  latest in thread

Message-ID: <1181997020.5953.170.camel@localhost.localdomain>
Permalink:  ../1181997020.5953.170.camel@localhost.localdomain/
Also on:    postgresql.org/message-id/1181997020.5953.170.camel@localhost.localdomain

 · 

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-performance@postgresql.org
  Cc: gnari@hive.is, okparanoid@free.fr
  Subject: Re: determining maxsize for character varying
  In-Reply-To: <1181997020.5953.170.camel@localhost.localdomain>

* 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