Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Implementation of boolean types.
"Eagle Fan" <eagle.f_at_gmail.com> wrote in message
news:1121421448.738223.140180_at_f14g2000cwb.googlegroups.com...
> Nod. Seems char(1) takes less space than number;
> SQL> select dump(x) from tt1;
>
> DUMP(X)
> --------------------------------------------------------------------------------
> Typ=2 Len=2: 193,2
>
> SQL> desc tt1
> Name Null? Type
> ----------------------------------------- --------
> ----------------------------
> X NUMBER
>
> SQL> select dump(x) from tt2
> 2 ;
>
> DUMP(X)
> --------------------------------------------------------------------------------
> Typ=96 Len=1: 49
>
> SQL> desc tt2
> Name Null? Type
> ----------------------------------------- --------
> ----------------------------
> X CHAR(1)
>
> But how about the speed when do equal search, order by or other
> operations?
>
Well it can only be '1' or '0'. An index + up-to-date statistics (possibly with histograms if distribution is skewed) should make queries ultra-fast, independent of the data type. Received on Fri Jul 15 2005 - 05:15:10 CDT