Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to understand SAP HANA Hint

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article shows you how to understand SAP HANA Hint, the content is concise and easy to understand, can definitely brighten your eyes, through the detailed introduction of this article, I hope you can gain something.

What is SAP HANA Hint?

HANA Hint is an instruction executed by the SAP14 HANA database server. HANA Hint affects the way a database request is generated and processed, but never changes the response result of those database requests. To put it colloquially, if you don't use Hint, execute a SQL statement to query N records. Then with Hint, the query result is still N. HANA Hint is often used to tune the performance of HANA, such as CPU to execute a SQL statement or memory usage.

There are several types of SAP HANA Hint:

1. SAP HANA DB Hints

Used directly in the SQL statement of HANA Studio. You can get all the Hint supported by the current version of HANA through select * from hints. On the HANA server I used, there were altogether 216s:

Usage: as shown in the red underline in the following figure:

If your Netweaver uses a database of HANA, and you want to use these Hint in ABAP Open SQL, you can use the syntax:% _ HINTS HDB followed by the specific content of Hint. For example, the following figure:

If the version of Netweaver is less than 740, you need to replace HDB with ADABAS.

2. SAP ABAP Hints

For those scenarios where the database used by Netweaver is non-HANA DB, you need to use a database provider-specific Hint. For details, you can query the corresponding SAP note.

130480 Database hints in Open SQL for Oracle

133381 Database hints in Open SQL for MS SQL Server

150037 Database hints in Open SQL for DB6 (DB2 UDB)

152913 Database hints in Open SQL for Informix

162034 DB2/390: Database hints in Open SQL

485420 iSeries: Database hints for Open SQL/Native SQL

652096 Database hints in Open SQL for SAPDB / MaxDB

1702338SYB: Database hints in Open SQL for Sybase ASE

The method used in ABAP's OPEN SQL is similar, replacing the HDB after% _ HINTS with the code of the specified database provider, plus the database provider-specific Hint.

The code names of database providers supported by ABAP can be found in ABAP help.

3. SAP HANA Calculation View Hints

Ce2qo_disable_unfolding

Ce2qo_for_nested_views_with_sql_execution

Enable_star_join_ceqo

Ce2qo_for_unit_conversion

Qo_pop_hints

Query_level_sql_hints

This type of Hint is used for Calculation View created in HANA Studio, rather than CDS (Core Data Service) View created by ABAP Development Tool. I haven't used it. I can't give an example.

For more details, please consult SAP note 2509161.

Introduction to HANA Hint in common use

A detailed list can be found in the body of note 2142945, so I won't go into it here. It is worth mentioning that there is no uniform best practice such as "applying so-and-so hint will certainly improve performance." The use of Hint needs to be analyzed according to specific SQL statements, and there is no way to generalize.

The most extreme examples are this pair of mutually exclusive Hint: CS_JOIN and NO_CS_JOIN, which are used to advise HANA databases to respond to data requests with or without Column Store Join.

An example of my actual work: this simple report reads 100 descriptions of service orders containing the text "2017-12-11" from the HANA database:

It took a total of 15 seconds:

And when I add NO_CS_JOIN 's hint,

The performance improved to less than 1 second to complete the data query.

Many other useful note are included at the end of note 2142945. If my job needs in the future, I will translate these note into Chinese one after another and add my own understanding.

The above content is how to understand SAP HANA Hint. Have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report