Hi there
the details of the inner workings of the SAP HANA execution engines and optimizers are not officially documented or available outside SAP.
What I can tell is that the picture above is partly outdated and partly a simplification and you really shouldn't conclude performance characteristics from it.
So I can only comment on the point
- CE Functions => Execution in Calculation engine ( hence more optimized)
This is a wrong understanding.
CE functions are not more optimized, faster, more efficient or whatnot.
The SQL commands processed by HANA internally will use the same code than the CE functions.
The major benefit of using SQL however is: with CE functions you tell the database what computations steps to do. It's very low level interaction with the query processing and the developer must care for a whole lot of things - many of them not available to decide during development time.
With SQL this goes away.
Just like other SQL databases, your SQL statement specifies the semantics of your query. You tell the database what conditions the result set should fulfill but not how to best compute it.
As the decision of the most optimal (fastest) way to compute a query result depends on many variables (underlying data, provided conditions, software capabilities, resource availability, etc..) this decision is best taken at the moment of query execution - not when you design the query.
That way your query can make use of newer, improved HANA capabilities and HANA can adapt its execution strategy, without ever changing your code.
So, again, stop using CE functions and use more current HANA revisions (SPS 8 is two major releases old now)!
As a last word: looking at the available literature on query optimization for the more classic players in the DBMS market you will find that it is a pretty complex topic.
However, most of the row-store disk-based orient products follow similar approaches when it comes to query optimization. Common access paths and join implementations (index search, hash/sort merge/nested loop, ...) are used throughout most of them and usually even understood conceptually by non-DB experts.
And herein lies a little problem - those shared, well-known techniques that are so easy to understand are massive simplifications of what actually happens.
With column store, based in-memory, highly parallel data processing in SAP HANA the applied execution methods and with it the approaches to optimize their use for a query, are a lot more complex.
What I'm saying is this: this topic is complex and highly volatile as the developers are constantly trying to improve the support for ever new usage pattern. Don't expect easy answers and don't hope that what you know about SPS8 optimization will hold true in SPS10...
- Lars