Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Index usage

0 Kudos

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Answer is option c & e.

Regards,

Amit

3 REPLIES 3

Former Member
0 Kudos

Hi,

Answer is option c & e.

Regards,

Amit

madan_ullasa
Contributor
0 Kudos

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...

Former Member
0 Kudos

Hi,

You have to use all the fields used for indexing in where clause of the select query.

Regards,

Renjith Michael.