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 implications of CHAR vs VARCHAR(2)

Re: Performance implications of CHAR vs VARCHAR(2)

From: <tsmihm_at_my-deja.com>
Date: 2000/03/21
Message-ID: <8b8tm0$1cq$1@nnrp1.deja.com>#1/1

The biggest performance problem will be that of your developers if you use CHAR for variable-length data. CHAR is fine, and most efficient for fields that can always be expected to have exactly (n) characters of data. If the length of the data will ever vary at all, use VARCHAR2, or else parameterized queries won't find the expected results.

Performance differences also only come into play if the values would be modified very much at a later time. For example, if a new record is inserted as a varchar2 with a relatively short value (say 5 characters), and then later on the record is modified so that the value becomes 200 characters long, it's possible the record will no longer fit into its old space, and will need to be 'chained' into a new page. This could lead to some performance problems over time. But in general, use varchar2 whenever you can, especially if the length of data can change, and if you ever plan to search against that field with a parameterized query.

Terry Mihm
mihm_at_objectsamurai.com

In article <38D7EE6E.1626998A_at_ny.email.gs.com>, Burt Laws <Burt.Laws_at_ny.email.gs.com> wrote:
> Is anyone aware of any implications (beyond disk i/o) one would have
 by
> using CHAR type fields vs VARCHAR(2) type fields.
>
> Thanks in advance!
> Bert
>
>

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Tue Mar 21 2000 - 00:00:00 CST

Original text of this message

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