create index [message #534479] |
Tue, 06 December 2011 09:21 |
varunvir
Messages: 389 Registered: November 2007
|
Senior Member |
|
|
Hi Experts,
I have column containing three values:-N,E,Y.
I want to get results with only E and Y values.
Is it it possible to create index which would not
look for N values.
Thanks,
Varun
|
|
|
|
|
Re: create index [message #534484 is a reply to message #534483] |
Tue, 06 December 2011 09:41 |
cookiemonster
Messages: 13958 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
In that case an index is probably a waste of time. You need to retrieve 99.9999% of rows. A full table scan is the best way.
|
|
|
|
Re: create index [message #534488 is a reply to message #534485] |
Tue, 06 December 2011 10:09 |
varunvir
Messages: 389 Registered: November 2007
|
Senior Member |
|
|
Thanks a lot Blackswan.Full table scan is definitely the
appropriate way for oracle in this case.
I am just curious though how would i create index which would not look for N values.
Thanks,
Varun
[Updated on: Tue, 06 December 2011 10:09] Report message to a moderator
|
|
|
|
Re: create index [message #534491 is a reply to message #534489] |
Tue, 06 December 2011 10:26 |
cookiemonster
Messages: 13958 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
create index <index_name> on <table> (decode(<column>, 'N', null, <column>));
You would then have to use that decode statement in the where clause of your queries.
|
|
|
|
|
|
|
|
Re: create index [message #534578 is a reply to message #534575] |
Wed, 07 December 2011 07:57 |
|
Michel Cadot
Messages: 68716 Registered: March 2007 Location: Saint-Maur, France, https...
|
Senior Member Account Moderator |
|
|
Unless this is an OLTP table, in this case this might help to kill your performances.
Regards
Michel
|
|
|