Re: char(1) vs Number(1)

From: Mark D Powell <>
Date: Tue, 1 Dec 2009 06:12:23 -0800 (PST)
Message-ID: <>

On Nov 30, 1:58 pm, joel garry <> wrote:
> On Nov 30, 9:59 am, CrazyKarma <> wrote:
> > Quick check on whether char(1) is more efficient than number (1).
> > Basically storing a bit value of either 0 or 1. since this is a
> > numeric maybe its better to store this as number(1).
> > Did a simple test for 1million rows, the IO cost is the same but the
> > number of bytes is double with number(1).
> > This makes me think that char(1) is more efficient in storage.
> > any thoughts?
> Yes, not having a boolean datatype is a bit of a frustration in
> Oracle.  See
> Oh wait, everything I know is wrong:
> jg
> --
> is bogus.

I do not think OLAP data types which are not the same as database data types which in turn are not the same as pl/sql data types of the same name applies to the question at hand. Example maximum length of a database varchar2 is 4000 bytes while in pl/sql a varchar2 may be up to 32K in length.

I would suggest using varchar2 over character even for char(1) since when you include the internal null indicator/length bytes both a char (1) and a varchar2(1) take two bytes of space.

HTH -- Mark D Powell -- Received on Tue Dec 01 2009 - 08:12:23 CST

Original text of this message