Application Development and Automation 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: 
Read only

Find index

Former Member
0 Likes
695

hi

how can i know the index, which was used in the report.

ex: i developed one report on sto's

i want to know which index used in mseg table

explain briefly

Regards

Anand

hi

how can i know the index, which was used in the report.

ex: i developed one report on sto's

i want to know which index used in mseg table

explain briefly

Regards

Anand

3 REPLIES 3
Read only

Former Member
0 Likes
655

hi

Go to MSEG table, there you can find 'INDEXES' button. Press that. You can find list of all indexes. Check with that. You can get wanted one.

Reward if it dose

Thanks

Siva Kumar

Read only

Former Member
0 Likes
655

Hi

The index to be used is triggered automatically by the system and it depends how the WHERE conditions are written, i.e. it depends on the order of the fields:

SELECT * FROM MSEG WHERE MBLNR  =
                           AND MATNR  =
                           AND WERKS =

If there's the system'll try to use an index with the fields MBLNR/MATNR/WERKS else a index with fields MBLNR/MATNR else an index with MBLNR.

If there's a index with fields MBLNR/WERKS it can use only if it re-writes the select:

SELECT * FROM MSEG WHERE MBLNR  =
                           AND WERKS =
                           AND MENTR =

Max

Read only

Former Member
0 Likes
655

The index is used per SELECT statement, not per report or table.

The information is not available on the application server only on the database,

i.e. you must trace the execution with the SQL Trace and the explain connects to the db and shows the index.

In most cases the index is used, which you would expect to be optimal, but sometimes not.

How to use the SQL trace can be found here:

/people/siegfried.boes/blog/2007/09/05/the-sql-trace-st05-150-quick-and-easy

Siegfried