Re: Size of varchar
Posted in 1998
Arun Shastry wrote in message <361B9044.8550E520@accentsoftware.com>... >The Wilcoxons wrote: > >> Tom Grenier wrote in message <361AA3C7.9D87A721@biztravel.com>... >> >If I have a varchar that the developers are not sure how large it will >> >be -- they guess 50-100 chars but may grow later -- and is not going to >> >be indexed -- is there any reason *not* to create it as a varchar(255)? >> >From all I can read there is no more overhead or space taken with a >> >varchar(255) where all data are less then 100 chars than defining it as >> >a varchar(100). >> > >> >Am I overlooking something? >> > >> >TIA, >> >Tom Grenier >> >DBA, Biztravel.com >> >> A larger varchar will use more memory internally and in applications. There >> may be some extra overhead on the CPU during some applications. >> > >I'm not sure about this. The way varchar is stored internally is the first >byte >is allocated to the size of the column and other such info., while the >entire varchar structure internally cannot exceed 256 bytes. Hence the >1 + 255 implementation. I was thinking more about the space that would be reserved and that some applications that aren't smart enough doing things like clearing the entire buffer, etc. Rereading my post I do see that I was not clear enough that it would not a be significant increase. S.W. wilcoxon@pioneerplanet.infi.net