Application Development 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: 

SAP Sorting and Search algorithms

Former Member
0 Kudos

Greetings,

I've been looking around but could not find a good answer regarding what kind of algorithms SAP uses for Sorting and searching.

My guess is that SAP uses quick sort or radix sorts perhaps for sorting and linear search/brute force for reads. Any input on this would be appreciated.

1 ACCEPTED SOLUTION

former_member192616
Active Contributor
0 Kudos

Hi,

are you talking about internal tables?

> My guess is that SAP uses quick sort or radix sorts perhaps for sorting

i learnt it is something "very similar to quick sort"

> and linear search/brute force for reads. Any input on this would be appreciated.

linear, binary or hash search alogrithms are used (depends e.g. on table type)

Kind regards,

Hermann

7 REPLIES 7

former_member192616
Active Contributor
0 Kudos

Hi,

are you talking about internal tables?

> My guess is that SAP uses quick sort or radix sorts perhaps for sorting

i learnt it is something "very similar to quick sort"

> and linear search/brute force for reads. Any input on this would be appreciated.

linear, binary or hash search alogrithms are used (depends e.g. on table type)

Kind regards,

Hermann

Former Member
0 Kudos

Hi,

Indeed, I'm talking about internal tables.

If anyone can add more comments to confirm the algorithms used (specially for the sorting part) with a reliable source where the information came from, I'm good to go.

Former Member
0 Kudos

This message was moderated.

Former Member
0 Kudos

Hi, Search/Read part is already answered. Thanks.

To fully answer my concern, I require confirmation (with a source,such as an article, book citation, book, etc.) about the Sorting algorithm.

Edited by: Tree Sap on Jan 13, 2011 4:37 PM

0 Kudos

> To fully answer my concern, I require confirmation (with a source,such as an article, book citation, book, etc.) about the Sorting algorithm.

are you interested in the algorithm (which i think is not published) or in the scalling behaviour (e.g. sort is n * log(n) like quick sort, binary search is log(n) linear search is n which is documented...)?

Kind regards,

Hermann

0 Kudos

Hi.

Indeed, I'm interested in the "scalling behaviour (e.g. sort is n * log(n) like quick sort, " /Big O/BigOmega performance behavior.

I'm required to make a mathematical analysis of the sorting performance used by SAP vesus certain amount of reads. I don't need to know the source code for the algorithm that SAP uses, but instead, the name of the algorithm or it's relative computational complexity(Big O, (e.g. sort is n * log(n) like quick sort)

e.g. "On XSAP book page 23, it is sugested that SAP uses something similar to quick sort" or "wikipedia.org/SAP_performance mentions that SAP has a computational complexity for sort in the order of 2n * log(n) +k"......

0 Kudos

Hi,

> Indeed, I'm interested in the "scalling behaviour (e.g. sort is n * log(n) like quick sort, " /Big O/BigOmega performance behavior.

you can find them in standard sap courses (BC490, BC402) and in blogs by Siegfried and in books (e.g. http://www.sap-press.com/products/ABAP-Performance-Tuning.html or http://www.dpunkt.de/buecher/3096/performance-optimierung-von-abap%26reg%3B-programmen.html)

> I'm required to make a mathematical analysis of the sorting performance used by SAP vesus certain amount of reads.

As a rule of thumb if i remember right i learnt one should have ~50 reads before a sort pays off. Maybe Siegfried cann tell you more here.

Kind regards,

Hermann