RE: Indexing NULL in the Oracle Database, is this the best practice?

From: Reen, Elizabeth <"Reen,>
Date: Thu, 29 Dec 2016 17:05:30 +0000
Message-ID: <258575162B63424EB58DAE3A5475B6ED0124B11F5D_at_EXNJMB25.nam.nsroot.net>



Null cannot be indexed by itself. It can be indexed as the second column of an index. So you could index emp_num, date_of_birth. Since everyone has a birth date, I would make the column not null and solve the problem that way. If birth date is optional, you can still index the column. It will just not get the rows which are null.

Liz Reen
Long suffering DBA

From: oracle-l-bounce_at_freelists.org [mailto:oracle-l-bounce_at_freelists.org] On Behalf Of Juan Carlos Reyes Pacheco Sent: Tuesday, December 27, 2016 9:24 AM To: ORACLE-L
Subject: Indexing NULL in the Oracle Database, is this the best practice?

Hello, please :)

CREATE INDEX emp_dob ON employees (date_of_birth, '1')

http://use-the-index-luke.com/sql/where-clause/null/index<https://urldefense.proofpoint.com/v2/url?u=http-3A__use-2Dthe-2Dindex-2Dluke.com_sql_where-2Dclause_null_index&d=DQMFaQ&c=j-EkbjBYwkAB4f8ZbVn1Fw&r=yWMFosURAngbt8VLeJtKLVJGefQxustAZ9UxecV7xpc&m=9lPbhytWad3njvs48qFMux-o0SZ_wOBHeQ_SfNDiQ8o&s=Av9Km_3UEKtzLeR28l5HjmGH2htxR21iEJ8Uupxcdzc&e=>

--
http://www.freelists.org/webpage/oracle-l
Received on Thu Dec 29 2016 - 18:05:30 CET

Original text of this message