2007 Dec 06 8:40 AM
hi ...
hw can i know the which index using in the select statment in the report s
Regars
Anand
2007 Dec 06 8:44 AM
uses <b>clustered index</b> to return the resultset efficiently and speedily
SELECT statement is not necessarily optimized by the database system or executed with the correct index. This can result in increased runtime costs. You should only use ORDER BY if the database sort uses the same index with which the table is read. To find out which index the system uses, <b>use SQL Trace in the ABAP Workbench Performance Trace.</b> If the indexes are not the same, it is more efficient to read the data into an internal table or extract and sort it in the ABAP program using the SORT statement.
Message was edited by:
Abap-fresher
hi ...
hw can i know the which index using in the select statment in the report s
Regars
Anand
2007 Dec 06 8:44 AM
uses <b>clustered index</b> to return the resultset efficiently and speedily
SELECT statement is not necessarily optimized by the database system or executed with the correct index. This can result in increased runtime costs. You should only use ORDER BY if the database sort uses the same index with which the table is read. To find out which index the system uses, <b>use SQL Trace in the ABAP Workbench Performance Trace.</b> If the indexes are not the same, it is more efficient to read the data into an internal table or extract and sort it in the ABAP program using the SORT statement.
Message was edited by:
Abap-fresher
2007 Dec 06 9:28 AM
Sorting by the Primary Key
To sort the selection set in ascending order by the primary key, use the following:
SELECT <lines> *
...
... ORDER BY PRIMARY KEY.
This sorting method is only possible if you use an asterisk (*) in the SELECT clause to select all columns. Furthermore, it only works if you specify a single database table in the FROM clause. You cannot use views or joins, since neither has a defined primary key.
2007 Dec 06 11:59 AM
don't understand how the answers relate to the question.
The actual index can only be seen in the SQL trace, see my SQL trace blog:
/people/siegfried.boes/blog/2007/09/05/the-sql-trace-st05-150-quick-and-easy
of course, one can often guess from the runtimes whether the right index is used or not.
Siegfried
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |