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

Visualize a Graphical Query Plan

Generate and compare query plan for in-memory and extended tables.

Overview

🎓 beginner 15 min. SAP HANA Dynamic TieringBeginnerSAP HANASAP HANA StudioBig DataSql

You will learn

  • โœ”Understanding the outline of query optimization within SAP HANA.
  • โœ”Generating an Prepared graphical Query Plan.
Unknown U Unknown November 1, 2022
Created by December 14, 2016
Contributors

Prerequisites

Prerequisites

  • Proficiency: Intermediate
  • System: Access to an SAP HANA 2.0 system with the optional SAP HANA Dynamic Tiering component installed.
  • Integrated Development Environment: Basic working knowledge of SAP HANA Studio. E.g. You should be able to connect to your HANA instance from SAP HANA Studio and feel comfortable with executing simple queries.
  • Tutorials: Create Tables and Import Data. This includes the TPCH user with all the permissions and the created tables with all the sample data loaded.

Steps

Next Steps

Time to Complete

20 Min.


Step 1 Refresh Data
โ€”

This tutorial assumes that you have completed all the prerequisites tutorials. You should have setup Dynamic Tiering, created a TPCH schema, created tables, and imported data into those tables. To ensure that the tutorial steps will run smoothly, we will start by refreshing the data in the tables used in this tutorial

In SAP HANA Studio, go to SAP HANA Administration Console perspective.

Administration Console
Administration Console

In the Systems tab on the left hand side, right click on the system you are working with, and select Open SQL Console.

SQL Console
SQL Console

Copy and run the script below in the SQL console to refresh the data. Make sure you replace each instance of “<SID>” in the script with your system’s System Id. Verify everything executed successfully.

SQL
TRUNCATE TABLE "TPCH"."LINEITEM_DT";
TRUNCATE TABLE "TPCH"."LINEITEM_CS";
TRUNCATE TABLE "TPCH"."PARTSUPP_CS";
TRUNCATE TABLE "TPCH"."PART_DT";
DELETE FROM "TPCH"."PART_CS";

IMPORT FROM CSV FILE '/hana/shared/<SID>/HDB00/work/TPCH_DATA/Part.csv' INTO TPCH.PART_CS
  WITH THREADS 4 BATCH 10000;

IMPORT FROM CSV FILE '/hana/shared/<SID>/HDB00/work/TPCH_DATA/LineItem.csv' INTO TPCH.LINEITEM_CS
  WITH THREADS 8 BATCH 10000;

IMPORT FROM CSV FILE '/hana/shared/<SID>/HDB00/work/TPCH_DATA/PartSupp.csv' INTO TPCH.PARTSUPP_CS
  WITH THREADS 4 BATCH 10000;

IMPORT FROM CSV FILE '/hana/shared/<SID>/HDB00/work/TPCH_DATA/Part.csv' INTO TPCH.PART_DT;

IMPORT FROM CSV FILE '/hana/shared/<SID>/HDB00/work/TPCH_DATA/LineItem.csv' INTO TPCH.LINEITEM_DT;

Refresh Data
Refresh Data

Step 2 Overview of Query Optimization
+
Step 3 Visualize Query for In-Memory Table
+
Step 4 Visualize Query for Extended Table
+

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. Refresh Data 2. Overview of Query Optimization 3. Visualize Query for In-Memory Table 4. Visualize Query for Extended Table

Learn more →