cancel
Showing results for 
Search instead for 
Did you mean: 

Sap Hana Online Table Partitioning - Example

VishuKumarKura
Discoverer

What is Hana Partitioning?

The partitioning feature of the SAP HANA database splits column-store tables horizontally into disjunctive sub-tables or partitions. In this way, large tables can be broken down into smaller, more manageable parts. Partitioning is typically used in multiple-host systems, but it may also be beneficial in single-host systems. Typical advantages of partitioning are e.g. partition pruning and an improved performance of the delta merge operation.

Furthermore, keep in mind that execution of the partitioning can take a long time, has a relatively high memory consumption and requires an exclusive lock (only selects are allowed).
But with the right partitioning which fits to the where clause of a SQL statement, only a single partition has to be accessed in best case. And the result is a better query performance and a faster and leaner delta merge operation

Below is example for CE11000 table :

As a pre-requisite need to check below parameter : SML - statement Memory Limit

1) In our case it was set to 100GB.

VishuKumarKura_0-1710055200223.png

SML was changed to 300GB

VishuKumarKura_1-1710055220803.pngVishuKumarKura_2-1710055228187.png

2) we need to set log_mode to overwrite & enable_auto_log_backup to no

VishuKumarKura_10-1710056484572.png

Now go to LTRC - Respective schema -> Suspend CE11000 table 

VishuKumarKura_3-1710055274790.pngVishuKumarKura_4-1710055350476.png

Add Partition command under -> LTRS -> Advance Replication settings -> Table settings ->

PARTITION BY HASH (BELNR) PARTITIONS 8 , as shown below and save

VishuKumarKura_5-1710055429141.png

Now login into HANA Studio which has SYSTEM ID roles to run Alter query

VishuKumarKura_6-1710055769556.pngVishuKumarKura_7-1710055830131.png

Thread Details :

VishuKumarKura_8-1710056205874.png

VishuKumarKura_9-1710056365135.png

VishuKumarKura_11-1710056579770.png

VishuKumarKura_16-1710057187199.png

 

Query took ~53 minutes

Post completion:

VishuKumarKura_13-1710056814897.png

VishuKumarKura_15-1710056927756.png

SML was changed back to 100GB post completion. As a best practice SML should be 2*Table_HANA_MEMEORY + 50GB(Delta working space).

Resume the replication of CE11000 post completion of online partition to clear off all logging table entries.

Refer below OSS notes :

2044468 - FAQ: SAP HANA Partitioning

2418299 - SAP HANA: Partitioning Best Practices / Examples for SAP Tables

 

 

 

 

 

 

 

 

Accepted Solutions (0)

Answers (1)

Answers (1)

VishuKumarKura
Discoverer
0 Kudos

Once the activity is completed kindly revert the below changes which was made before performing online partitioning - step 2

VishuKumarKura_0-1711196855051.png

Thanks