SAP Home Learn Build Integrate Model Operate Extend with AI ConnectTutorial navigator Knowledge Graph API Devtoberfest Developer Advocates App Space

Manage my Account SAP Devs YouTube ↗ Learnings ↗ Community ↗ Provide Feedback ↗
Logout
โคข Open full site

Improve Query Performance in a Multi-Source Data Landscape

Improve the performance of complex queries in a hybrid scenario using replicas and static result cache in SAP HANA Cloud, SAP HANA database.

Overview

🎓 beginner 10 min. SAP HANA CloudBeginnerSAP HANA CloudSAP HANA DatabaseSAP HANAData Lake

You will learn

  • โœ”What options are available to you to improve the performance of queries in a complex set up.
  • โœ”How to create snapshot replicas
  • โœ”How to use static result cache
Christopher Kollhed C Christopher Kollhed November 1, 2022
Created by August 15, 2021
Contributors

Prerequisites

Prerequisites

  • A running SAP HANA Cloud, SAP HANA database instance in trial or production.
  • A multi-source data landscape like the one set up in this tutorial group.
  • An SAP HANA on-premise system with SPS04 Rev45 or higher.
  • Completion of the previous tutorials in this group is recommended.

Steps

Intro

In this tutorial, you will learn how to improve the performance of complex queries in the multi-source data-landscape that we have set up in our SAP HANA Cloud instance. First, for a quick reminder of what was covered in this group so far, you can have a look at the hybrid landscape we have created:

Non-SAP cloud databases
Non-SAP cloud databases

Another element in our landscape is a connection to an SAP HANA on-premise database connected via SDA and SDI.

HC and on-premise
HC and on-premise

This landscape serves as an example for a multi-source, hybrid data landscape. Of course, your landscape may look different. The steps described in this tutorial are meant to give you guidance how to apply the techniques to your own landscape.

Attention trial users: Since in this specific data landscape, we have two SAP HANA Cloud, SAP HANA database instances, the exact landscape cannot be replicated in a trial environment due to the limitation to one instance. Nevertheless, you can still create a multi-source environment in trial and use the query performance methods mentioned in this tutorial.


Step 1 Query data from multiple sources
โ€”

To query the data from various sources in a landscape, you can simply include the virtual objects in your queries. Keep in mind that for queries containing objects found in Google BigQuery, you need to put object names in "quotes" to handle the lower-case characters that are set as default in Google BigQuery.

Creating a consolidated view

For example, to conveniently access to data from different source tables in one action, you can create a consolidated view that joins the data from these tables using this statement in a SQL Console of your SAP HANA Database Explorer:

SQL
create view <SCHEMA>.<VIEW_NAME> as ((select * from <SCHEMA>.<TARGET_TABLE1>) union (select * from <SCHEMA>.<TARGET_TABLE2>));

All you need to do is specify a name for this view and the source tables you want to join. Once the view is created, you can easily access the data from both source tables in one query.

Step 2 Get to know query performance improvement methods
+
Step 3 Create a snapshot replica
+
Step 4 Use static result cache
+

Resources

Discussion

Share feedback on this tutorial or join the conversation in SAP Community.

Submit detailed feedback Discuss in Community
Steps
Step 1 of 4
1. Query data from multiple sources 2. Get to know query performance improvement methods 3. Create a snapshot replica 4. Use static result cache

Learn more →