Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

index range scan on null column

653864Aug 6 2008 — edited Aug 7 2008
Hi !

I have a table:
Name Null? Type
------------------------------------------------------------------------ -------- -------------------------------------------------
ID NOT NULL NUMBER
ID_SSO VARCHAR2(50)
ID_BOX NOT NULL NUMBER(9)
FIRSTNAME VARCHAR2(240)
SURNAME VARCHAR2(240)
PHONE_NUMBER VARCHAR2(240)
EMAIL VARCHAR2(240)
STATUS NOT NULL NUMBER(1)

index:
create index bsm.I_MB_TEMP on bsm.internet_user(id_sso);

query:
SELECT id, id_sso, id_box, firstname, surname, phone_number, email, status FROM bsm.internet_user WHERE id_sso = 'l';

query plan:
PLAN_TABLE_OUTPUT
------------------------------------------------------------------------------------------------------------------------------------
Plan hash value: 555049175

---------------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
---------------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 34 | 2 (0)| 00:00:01 |
| 1 | TABLE ACCESS BY INDEX ROWID| INTERNET_USER | 1 | 34 | 2 (0)| 00:00:01 |
|* 2 | INDEX RANGE SCAN | I_MB_TEMP | 1 | | 1 (0)| 00:00:01 |
---------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

2 - access("ID_SSO"='l')

and now: id_sso column is null for >90% of rows. is there a better index/solution to speed up the query I mentioned ? I do not want to search for nulls in id_sso. I am only interested in values != null. and yes, I know that bind variables are better solution ;-)

thanks in advance
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 4 2008
Added on Aug 6 2008
4 comments
498 views