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

internal table-performance

Former Member
0 Likes
1,385

hi all ,

on performance vise which internal table is better..

standard or sorted or harshed . why

1 ACCEPTED SOLUTION
Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
853

Hi,

It depends on performance in WHAT?

IF you want to READ using table key then HASHED table is the best.

Then Sorted Table and at last Standard tables.

WHEN you want to READ using INDEX then you can do that only in STANDARD and SORTED Tables. They both are equally good.

Regards,

Sesh

6 REPLIES 6
Read only

Former Member
0 Likes
853

Hi,

Hashed table is useful when your have to work with very big internal table and to read it with

"READ TABLE WITH KEY ..."

The time access is constant !

Definition of a Hashed Table:

"Defines the table as one that is managed with an internal hash procedure. You can imagine a hashed table as a set, whose elements you can address using their unique key. Unlike standard and sorted tables, you cannot access hash tables using an index. All entries in the table must have a unique key.

Access time using the key is constant, regardless of the number of table entries.

You can only access a hashed table using the generic key operations or other generic operations (SORT, LOOP, and so on). Explicit or implicit index operations (such as LOOP ... FROM to INSERT itab within a LOOP) are not allowed."

As long as your records has unique key(s), using hash table will give you a huge performance gain when dealing with large dataset. assuming in your case, 10000 record , and if the key is unique, use hash table. The main use of hash tables is for looking up fixed information from a key. So if you have a report that has personnel number and you want to display their name, you could use a hash table.

Reward if useful!

Read only

Former Member
0 Likes
853

standard internal table is the best one... It holds data which can be read easily using binary search after sorted on some keys.

Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
854

Hi,

It depends on performance in WHAT?

IF you want to READ using table key then HASHED table is the best.

Then Sorted Table and at last Standard tables.

WHEN you want to READ using INDEX then you can do that only in STANDARD and SORTED Tables. They both are equally good.

Regards,

Sesh

Read only

Former Member
0 Likes
853

Performance wise it is

Hashed table

Sorted

Standard

To Read data from a table with X entries, the average seek time is

Hashed table 1

Sorted table LN( X ) + 1

Standard table ( X / 2 ) + 1

Please keep in mind, that a standard table has to be sorted to read binary search wise. In that case you have a sorted standard table

Christian

Read only

0 Likes
853

Hi

u can use

sort itab.

read table with key vbeln = itab-vbeln binary search .

Read only

Former Member
0 Likes
853

Hi Suprith,

It all depends on the type of data you are holding.If your data is huge in no then Hashed table is the best , because the it gives the data in constant time.

If you knw the index of the data then Standard table is the best.

You can use a binary search on Sort table. But mind you Sorting of data again takes time.

So, It all depends on your requirement what type of data you are handling.

rewards points if helpful.

regards

Sourabh Verma