Transcript
Page 1: Various Table Partitioning in SAP HANA

Various Table Partitioning in SAP HANA Prepared by Debajit Banerjee

http://debajitb.wix.com/debajitbanerjee | http://debajitb.wix.com/debajitbanerjee/apps/blog 1

For simplicity, here I have discussed only Single-Level Partitioning with all the three partitioning specifications - Hash, Range and Round-robin. Also I have shown the steps for re-distribution of all the partitions to different hosts in a distributed SAP HANA database.

Partitioning a Non-Partitioned Table ………………………………………………………………………………………… 2

Round-Robin Partitioning ……………………………………………………………………………………………………………. 2

Hash Partitioning ……………………………………………………………………………………………….. 8 Range Partitioning ……………………………………………………………………………………………… 14

Changing a Partitioned Table into a Non-Partitioned Table …………………………. 18

Page 2: Various Table Partitioning in SAP HANA

Various Table Partitioning in SAP HANA Prepared by Debajit Banerjee

http://debajitb.wix.com/debajitbanerjee | http://debajitb.wix.com/debajitbanerjee/apps/blog 2

Partitioning a Non-Partitioned Table

Round-Robin Partitioning – Table

Page 3: Various Table Partitioning in SAP HANA

Various Table Partitioning in SAP HANA Prepared by Debajit Banerjee

http://debajitb.wix.com/debajitbanerjee | http://debajitb.wix.com/debajitbanerjee/apps/blog 3

Page 4: Various Table Partitioning in SAP HANA

Various Table Partitioning in SAP HANA Prepared by Debajit Banerjee

http://debajitb.wix.com/debajitbanerjee | http://debajitb.wix.com/debajitbanerjee/apps/blog 4

Before doing a redistribution operation, it is always better to save the current configuration.

Page 5: Various Table Partitioning in SAP HANA

Various Table Partitioning in SAP HANA Prepared by Debajit Banerjee

http://debajitb.wix.com/debajitbanerjee | http://debajitb.wix.com/debajitbanerjee/apps/blog 5

Page 6: Various Table Partitioning in SAP HANA

Various Table Partitioning in SAP HANA Prepared by Debajit Banerjee

http://debajitb.wix.com/debajitbanerjee | http://debajitb.wix.com/debajitbanerjee/apps/blog 6

Page 7: Various Table Partitioning in SAP HANA

Various Table Partitioning in SAP HANA Prepared by Debajit Banerjee

http://debajitb.wix.com/debajitbanerjee | http://debajitb.wix.com/debajitbanerjee/apps/blog 7

Now, Round-robin Partitioning has been completed and Partitioned Tables also distributed between two hosts.

Page 8: Various Table Partitioning in SAP HANA

Various Table Partitioning in SAP HANA Prepared by Debajit Banerjee

http://debajitb.wix.com/debajitbanerjee | http://debajitb.wix.com/debajitbanerjee/apps/blog 8

HASH Partitioning - Table

Page 9: Various Table Partitioning in SAP HANA

Various Table Partitioning in SAP HANA Prepared by Debajit Banerjee

http://debajitb.wix.com/debajitbanerjee | http://debajitb.wix.com/debajitbanerjee/apps/blog 9

Page 10: Various Table Partitioning in SAP HANA

Various Table Partitioning in SAP HANA Prepared by Debajit Banerjee

http://debajitb.wix.com/debajitbanerjee | http://debajitb.wix.com/debajitbanerjee/apps/blog 10

Page 11: Various Table Partitioning in SAP HANA

Various Table Partitioning in SAP HANA Prepared by Debajit Banerjee

http://debajitb.wix.com/debajitbanerjee | http://debajitb.wix.com/debajitbanerjee/apps/blog 11

Page 12: Various Table Partitioning in SAP HANA

Various Table Partitioning in SAP HANA Prepared by Debajit Banerjee

http://debajitb.wix.com/debajitbanerjee | http://debajitb.wix.com/debajitbanerjee/apps/blog 12

Page 13: Various Table Partitioning in SAP HANA

Various Table Partitioning in SAP HANA Prepared by Debajit Banerjee

http://debajitb.wix.com/debajitbanerjee | http://debajitb.wix.com/debajitbanerjee/apps/blog 13

Now, Hash Partitioning of AUSP table has been completed and Partitioned Tables also distributed between 4 hosts.

Page 14: Various Table Partitioning in SAP HANA

Various Table Partitioning in SAP HANA Prepared by Debajit Banerjee

http://debajitb.wix.com/debajitbanerjee | http://debajitb.wix.com/debajitbanerjee/apps/blog 14

Range Partitioning - Table

Page 15: Various Table Partitioning in SAP HANA

Various Table Partitioning in SAP HANA Prepared by Debajit Banerjee

http://debajitb.wix.com/debajitbanerjee | http://debajitb.wix.com/debajitbanerjee/apps/blog 15

Page 16: Various Table Partitioning in SAP HANA

Various Table Partitioning in SAP HANA Prepared by Debajit Banerjee

http://debajitb.wix.com/debajitbanerjee | http://debajitb.wix.com/debajitbanerjee/apps/blog 16

Page 17: Various Table Partitioning in SAP HANA

Various Table Partitioning in SAP HANA Prepared by Debajit Banerjee

http://debajitb.wix.com/debajitbanerjee | http://debajitb.wix.com/debajitbanerjee/apps/blog 17

Now, Range Partitioning of KONV table has been completed. From the results, we can easily understand that distribution of records was not proper between all the partitions. What to do then?

Page 18: Various Table Partitioning in SAP HANA

Various Table Partitioning in SAP HANA Prepared by Debajit Banerjee

http://debajitb.wix.com/debajitbanerjee | http://debajitb.wix.com/debajitbanerjee/apps/blog 18

Changing a Partitioned Table into a Non-Partitioned Table As per the above Range partition results, it clearly depicts that distribution was not proper as Range selections were wrong. So, to rectify the same we have to follow the below process –

1) Changing Partitioned Table into a Non-Partitioned Table 2) Then Repartition the table with proper range selection

Select the Merge Partitions option.

Page 19: Various Table Partitioning in SAP HANA

Various Table Partitioning in SAP HANA Prepared by Debajit Banerjee

http://debajitb.wix.com/debajitbanerjee | http://debajitb.wix.com/debajitbanerjee/apps/blog 19

Once again, trying to do Range Partition now for better record distributions.

Page 20: Various Table Partitioning in SAP HANA

Various Table Partitioning in SAP HANA Prepared by Debajit Banerjee

http://debajitb.wix.com/debajitbanerjee | http://debajitb.wix.com/debajitbanerjee/apps/blog 20

Page 21: Various Table Partitioning in SAP HANA

Various Table Partitioning in SAP HANA Prepared by Debajit Banerjee

http://debajitb.wix.com/debajitbanerjee | http://debajitb.wix.com/debajitbanerjee/apps/blog 21

Page 22: Various Table Partitioning in SAP HANA

Various Table Partitioning in SAP HANA Prepared by Debajit Banerjee

http://debajitb.wix.com/debajitbanerjee | http://debajitb.wix.com/debajitbanerjee/apps/blog 22

===== End of Document ======


Recommended