Re: column size and storage efficiency

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: brucejhyatt(at)yahoo(dot)com
Cc: Sean Davis <sdavis2(at)mail(dot)nih(dot)gov>, pgsql-novice(at)postgresql(dot)org
Subject: Re: column size and storage efficiency
Date: 2008-11-26 15:19:46
Message-ID: 8761.1227712786@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Bruce Hyatt <brucejhyatt(at)yahoo(dot)com> writes:
> After thinking about it more, there can't be a direct relationship between number-of-characters and number-of-bits but what I meant was, if varchar(14) fills a block of storage, does varchar(15) use 2 blocks? Does it use twice the storage?

I think you still missed the point. The *declared* size of a varchar
column isn't what determines storage usage, it's the *actual* size of
any particular value. IOW, if all your strings are less than 15
characters, it makes no difference whether you declare the column
varchar(14), varchar(15), or varchar(6666).

regards, tom lane

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Pushpendra Singh Thakur 2008-11-26 16:01:15 PGCluster
Previous Message Bruce Hyatt 2008-11-26 15:10:44 Re: column size and storage efficiency