Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: O9i: general index question
On 3 Apr., 14:50, "Thorsten Kettner" <thorsten.kett..._at_web.de> wrote:
> CREATE INDEX idxBaeumeNebenanl ON tbBaeume
> (decode(CIDNEBENANLAGE,'0000000000',0,1));
>
> SELECT ... WHERE decode(CIDNEBENANLAGE,'0000000000',0,1) = 1
Hm, having mentioned that NULL is not stored in indexes you can extremely reduce the index size thus:
CREATE INDEX idxBaeumeNebenanl ON
tbBaeume(decode(CIDNEBENANLAGE,'0000000000',NULL,1));
SELECT ... WHERE decode(CIDNEBENANLAGE,'0000000000',NULL,1) = 1
(You see, when establishing computed indexes you should know about them and use the exact same expression in your select). Received on Tue Apr 03 2007 - 07:59:34 CDT