10-14-2008 7:13 AM
Table ztest has a secondary index on the following fields:
tnum, tcode.
Select * from ztest where tnum ne '123' and tcode = '456'.
Why is the index not used in the above case?
a) Indexes are not allowed on Z tables
b) Variables must be used, NOT literals
c) Select individual fields, not select *
d) Client is not in the where clause
e) NE invalidates the use of an index
Can you help me? Is it option a)?
Thanks & Regards,
Lohit
10-14-2008 7:15 AM
10-14-2008 7:15 AM
10-14-2008 7:17 AM
Hi,
There is nothing specific you need to do to use the indexed keys... Its more of an internal process for faster access of the values...Just see to that you use the keys in where condition in the same sequence as found in your table...
regds,
Madan...
10-14-2008 7:18 AM
Hi,
You have to use all the fields used for indexing in where clause of the select query.
Regards,
Renjith Michael.