List:General Discussion« Previous MessageNext Message »
From:living liquid | Christian Meisinger Date:May 29 2008 2:46pm
Subject:Re: Table Size
View as plain text  
Olaf Stein wrote:
> Because your int field always uses 4 bytes per record
> The varchar uses length + 1 bytes

i know... still i'm confused.

the average length of the refurl varchar is 12 character,
which means each row uses 12 + 3 bytes
which is about 3 times the integer would use.

i've create two tables with only the refurl columns:

refurl varchar: Data  	29,326.1  	KiB
                 Index 	4,084.0 	KiB

refurl integer: Data  	9,972.3  	KiB
                 Index 	17,933.0 	KiB

so the data size is what i would expect.
but i'm really surprised about the index size.

for me it seems so it depends on how you combine columns and indexes.
well i think i've to analyze a few tables because i always thought:
integer < varchar :)  (if avg string length > 4)

Table Sizeliving liquid | Christian Meisinger29 May
  • Re: Table SizeOlaf Stein29 May
    • Re: Table Sizeliving liquid | Christian Meisinger29 May
      • Re: Table SizeDan Nelson29 May
  • Re: Table SizeJoerg Bruehe29 May