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

read Table

Former Member
0 Likes
428

Hi Experts,

What is the Diffrence btwn

Read Table with Binary Search And

Read Table with index.

thanks.

Khan.

1 ACCEPTED SOLUTION
Read only

kiran_k8
Active Contributor
0 Likes
405

Khan,

Read table with binary search is the best way to read an table because it enhances performance provided we had sorted the table beforehand.

Suppose an internal table is having the following data

1 2 3 4 5 6 7 8 and we are reading the table where a field is equal to 4 then binayr search will split the search into two parts say

first it will search for 4 among 1 2 3 4.

as it was able to find 4 in this part it will come out and go ahead with the next process.Suppose if it didn't find 4 in the first part then and then only it will go for next part of the search.This way it enhances the performance.But it is mandatory to sort the internal table before reading the table using binary search.

K.Kiran.

Message was edited by:

Kiran K

3 REPLIES 3
Read only

Former Member
0 Likes
405

hi,

read table with index will locate correctly the record at the particular index,

with binary search will be useful if ur internal table is having larger number of records, ur perfomance ll be fast

regards

karthik

Read only

kiran_k8
Active Contributor
0 Likes
406

Khan,

Read table with binary search is the best way to read an table because it enhances performance provided we had sorted the table beforehand.

Suppose an internal table is having the following data

1 2 3 4 5 6 7 8 and we are reading the table where a field is equal to 4 then binayr search will split the search into two parts say

first it will search for 4 among 1 2 3 4.

as it was able to find 4 in this part it will come out and go ahead with the next process.Suppose if it didn't find 4 in the first part then and then only it will go for next part of the search.This way it enhances the performance.But it is mandatory to sort the internal table before reading the table using binary search.

K.Kiran.

Message was edited by:

Kiran K

Read only

Former Member
0 Likes
405

If you check the documentation for the READ statement, I think you'll see that using the index is faster than a binary search.

Rob