Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Does VARCHAR2 size matter?
"koert54" <nospam_at_nospam.com> wrote in message news:<3c61370b$0$7110$4d4efb8e_at_news.be.uu.net>...
> > Also depending on the maximum
> > length of the varchar2 variable Oracle requires two length bytes
> > instead of one for the column so you would be wasting one byte in
> > overhead for every varchar2 over the cut-off length X the number of
> > varchar2 variables over this length in the row X the number of rows in
> > the table so this can add up to be a signifcant number of bytes.
>
> Actually - after the cut-off point the length of a column is specified by
> 3bytes - not
> 2 bytes :-)
> If the length byte is FF -> the column contains a NULL
>
> "Mark D Powell" <mark.powell_at_eds.com> wrote in message
> news:178d2795.0202060536.572afbaa_at_posting.google.com...
> > Morten <morten_at_kikobu.com> wrote in message
> news:<3C6112F7.1070205_at_kikobu.com>...
> > > Hi. What consequences are there when using VARCHAR2(4000) rather
> > > than eg. VARCHAR2(500) columns? I'm wondering as VARCHAR2 is variable
> > > length, if there are any major performance reasons to keep the
> > > fields as small as possible, or if those reasons are more likely to
> > > be from a constraining/modelling perspective.
> > >
> > > Morten
> >
Yes, the length overhead bytes for long varchar2 columns is 3 not 2, which makes the overhead on a large table where a varchar2 column id declared with a much larger size than will ever exist even more wasteful.
![]() |
![]() |