Skip to Content
author's profile photo Former Member
Former Member

Creating Secondary Index in Z's Customer Table

Hello All,

I have created Customer Table and then added secondary index for improving fetching ( in QA),

after I created the Index I Used SE14 for Adjusting and activating the Index

and when i'm selecting with all the columns of the Index it still uses the primary (~000) Index instead of the secondary one.

I'm using Oracle DB.

What can I do In order to use the secondary index ?

Is DB20 will Solve the Problem?

Thanks,

Jenifer.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Posted on Jan 06, 2014 at 08:14 AM

    Hi Jenifer,

    does your where clause match with your secondary index? Can you please post your SQL statement for the table?

    Thanks,

    Dirk

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 06, 2014 at 03:23 PM

    That is standard behavior of an Oracle database today, read some document like 10 Optimizer Statistics Concepts in online Oracle help. There are also some OSS notes like 588668 - FAQ: Database statistics.

    Regards,

    Raymond

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 06, 2014 at 07:08 AM

    Hi,

    make a SQL trace on your report using the transaction ST05.

    In the report of this transaction you could ask the analyser why SAP used an index instead of another.

    Most of the times, the error is to forget the client (MANDT) field in the index.

    regards

    Fred

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 06, 2014 at 08:13 AM

    Is your where clause include fields in order of your secondary index?

    i.e. Query like below does not use your index even if it contains all fields of your sec. index.

    You should take care of order of fields at where clause.

    SELECT ... WHERE monat = 'A' AND

    cell_num= 'blabla' AND

    gjahr = 'XXXX' .

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.