Upload
debajit-banerjee
View
1.074
Download
42
Embed Size (px)
DESCRIPTION
Table partitioning is a data organization scheme in which table data is divided across multiple storage objects called data partitions. In SAP HANA database, it is possible to split column-store tables horizontally into disjunctive sub-tables or partitions. The SAP HANA database supports several redistribution operations that use complex algorithms to evaluate the current distribution and determine a better distribution depending on the situation. Partitioning is typically used in distributed systems, but it may also be beneficial for single-host systems. Partitioning is transparent for SQL queries and data manipulation language statements. In a distributed SAP HANA system, tables are assigned to an index server on a particular host at their time of creation, but this assignment can be changed. In certain situations, it is even necessary. In SAP HANA side-by-side implementation, SLT will stop replication when SAP HANA table reaches 2 billion records as a non-partitioned table cannot store more than 2 billion rows. Advantages of partitioning: + Load balancing in a distributed system + Overcoming the size limitation of column-store tables + Parallelization + Partition pruning + Improved performance of the delta merge operation + Explicit partition handling SAP HANA supports: - Hash Partitioning - Range Partitioning - Round-robin Partitioning
Citation preview
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
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
Various Table Partitioning in SAP HANA Prepared by Debajit Banerjee
http://debajitb.wix.com/debajitbanerjee | http://debajitb.wix.com/debajitbanerjee/apps/blog 3
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.
Various Table Partitioning in SAP HANA Prepared by Debajit Banerjee
http://debajitb.wix.com/debajitbanerjee | http://debajitb.wix.com/debajitbanerjee/apps/blog 5
Various Table Partitioning in SAP HANA Prepared by Debajit Banerjee
http://debajitb.wix.com/debajitbanerjee | http://debajitb.wix.com/debajitbanerjee/apps/blog 6
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.
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
Various Table Partitioning in SAP HANA Prepared by Debajit Banerjee
http://debajitb.wix.com/debajitbanerjee | http://debajitb.wix.com/debajitbanerjee/apps/blog 9
Various Table Partitioning in SAP HANA Prepared by Debajit Banerjee
http://debajitb.wix.com/debajitbanerjee | http://debajitb.wix.com/debajitbanerjee/apps/blog 10
Various Table Partitioning in SAP HANA Prepared by Debajit Banerjee
http://debajitb.wix.com/debajitbanerjee | http://debajitb.wix.com/debajitbanerjee/apps/blog 11
Various Table Partitioning in SAP HANA Prepared by Debajit Banerjee
http://debajitb.wix.com/debajitbanerjee | http://debajitb.wix.com/debajitbanerjee/apps/blog 12
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.
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
Various Table Partitioning in SAP HANA Prepared by Debajit Banerjee
http://debajitb.wix.com/debajitbanerjee | http://debajitb.wix.com/debajitbanerjee/apps/blog 15
Various Table Partitioning in SAP HANA Prepared by Debajit Banerjee
http://debajitb.wix.com/debajitbanerjee | http://debajitb.wix.com/debajitbanerjee/apps/blog 16
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?
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.
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.
Various Table Partitioning in SAP HANA Prepared by Debajit Banerjee
http://debajitb.wix.com/debajitbanerjee | http://debajitb.wix.com/debajitbanerjee/apps/blog 20
Various Table Partitioning in SAP HANA Prepared by Debajit Banerjee
http://debajitb.wix.com/debajitbanerjee | http://debajitb.wix.com/debajitbanerjee/apps/blog 21
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 ======