Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Does VARCHAR2 size matter?
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
To me, it just seems that if a data item is four characters in length then the table column to hold that data item should be defined as four characters in length and no more. 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.
The documentation used to say the cut-off point was 127 bytes (maximum positive integer that can be stored in 1 signed byte).
just IMHO. -- Mark D Powell -- Received on Wed Feb 06 2002 - 07:36:58 CST