Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Performance question

Re: Performance question

From: Eric Levinson <nospam_at_nospam.com>
Date: Wed, 29 May 2002 17:29:50 GMT
Message-ID: <ie8J8.4757$3w2.21689@typhoon.sonic.net>


Thanks for your answer, Howard, however it was not what I was asking.

For CHAR(10), what you stated applies.
For VARCHAR(10), the column is variable size regardless of the "10"

My question is, if I store the word 'test' in a VARCHAR2(10) column, is there another piece of data ONLY for varchar2 or any other datatype which is variable width which would store the number 4, so that LENGTH returns this value, or is this data NOT stored, and everytime LENGTH function is called, the database has to count characters in the VARCHAR2 field till it reaches some end of field mark (like hex FF)

Thanks,
Eric

"Howard J. Rogers" <dba_at_hjrdba.com> wrote in message news:ad14go$gkk$1_at_lust.ihug.co.nz...
> The format of a row is: row header, column length - value; column length -
> value; column length - value; and so ad infinitum (nearly).
>
> The length of a field is stored as an attribute within the row. If it was
> Name Char(10) it would be stored as :10:Smith-----: If it was Name
> varchar2(10) it would be stored as :5:Smith:
>
> Regards
> HJR
>
> "Eric Levinson" <nospam_at_nospam.com> wrote in message
> news:DjUI8.4416$3w2.19388_at_typhoon.sonic.net...
> > When a VARCHAR2 type column is defined, how does the LENGTH function get
> the
> > length of the varchar contained in the column? Does it count up the
> number
> > of bytes to some end of string marker, or is there an internally held
and
> > maintained attribute of varchar which maintains the size?
> >
> > Reason why I am asking, there might be a performance hit to use LENGTH
if
> it
> > has to calculate it every time.
> >
> > Any help would be appreciated
> >
> > oracle at levinsong dot com
> >
> >
>
>
Received on Wed May 29 2002 - 12:29:50 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US