Myth: Oracle Cannot Index NULL


The source of this myth is rather easy to understand when you look at the correctly expressed statement:

The Oracle database does not include rows into an index if all indexed columns are NULL.

The difference between the myth and the reality is small—it seems that they myth is a sloppy form of the truth.

The truth is that NULL can be indexed by adding another, not nullable, column to the index:

CREATE INDEX with_null ON table_name (nullable_column, '1');

Read Section 6.1 for the full story.

Recent Questions at Ask.Use-The-Index-Luke.com

0
votes
1
answer
229
views

query regd the CBO decision

Apr 17 at 10:27 Hulda(suspended)
index-choice optimizer
0
votes
3
answers
2.0k
views

Examples for Function Based Indexes?

Mar 25 at 15:52 Castorp 1
function-based
0
votes
1
answer
610
views

Updating multiple rows using a subquery in SQL

Jan 08 at 09:52 Jan 26
subquery update sql