‎2008 Jul 07 11:17 AM
Hi All,
Would the performance of sort be degraded if I used non-key fields rather than key fields for the sort command?
Thanks and Regards,
Vidya.
‎2008 Jul 07 11:22 AM
Hi
All char fields are key fields for an internal table, so the performance can be degraded only as y make one operation more the sorting, and this is not dependent on which fields used by the sorting.
The sorting needs to certain time and memory space, so u should do it only if u need it
Max
‎2008 Jul 07 11:22 AM
Hi
All char fields are key fields for an internal table, so the performance can be degraded only as y make one operation more the sorting, and this is not dependent on which fields used by the sorting.
The sorting needs to certain time and memory space, so u should do it only if u need it
Max
‎2008 Jul 07 11:31 AM
hi vidya,
i guess if we use non-key fields rather then key fields it would affect performance.
go through following link
http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3800358411d1829f0000e829fbfe/content.htm
also
SORT inside a LOOP should not used
Sort internal table by fields in the correct order, which are used in a READ TABLE statement using BINARY SEARCH. If the order of sorting is invalid the BINARY SEARCH will never work
For large internal tables where only some rows are to be processed, use SORT and then the READ TABLE command is used to set index to first relevant row before looping from that index. Use CHECK or IFu2026EXITu2026ENDIF as appropriate to exit from the loop
Sort fields and Sort Order on the SORT statement should be mentioned explicitly (e.g. SORT ITAB BY FLD1 FLD2 ASCENDING)
Hashed table is used for processing large amount of data (provided that you access single records only, and all with a fully specified key)
DELETE or SORT is not used on a hashed table since it increases memory consumption
Sorted table is used for range accesses involving table key or index accesses
Reward points if it is help full in any way
Regards,
SUDHIR MANJAREKAR
‎2008 Jul 07 12:20 PM
a SORT is only useful on a standard table
and a standard table has no real key. You can define something as key, but this has no effect.
Use SORT if you want display something in a certain order.
Or use SORT if you want to use READ BINARY SEARCH. The read binary search works always, but only correctly if the table is sorted in the same way.
Your table should only be sorted once program execution, I doubt that it will make sense to sort it several times.
Siegfried
‎2008 Jul 07 12:37 PM