10/17/24, 5:25 PM Table partition in HANA - SAP Community
m
m
Products and Technology Groups Partners Topics Events What's New Get Started Explore SAP
u
ni
t
SAP Communityy Products and Technology Technology Technology Blogs by Members Table partition in HANA
Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the
mix!
Blog What are you looking for today?
Table partition in HANA
former_member198758
Explorer
2019 Dec 18 11:13 AM
9 Kudos 44,398
SAP Managed Tags: BW SAP HANA Data Warehousing
TABLE partition in HANA: - for handling large data in a physical table.
HANA support maximum number of rows up to 2 billion so if we have more data then we may use table partition to
overcome this by distributing the rows of a column table on multiple partitions and hence the size limit is increase to 2
billion for each partition. We can chive Table partition concept using SQL. We need to select partition option wisely by
understanding table contents in depth.
https://community.sap.com/t5/technology-blogs-by-members/table-partition-in-hana/ba-p/13426395 1/11
10/17/24, 5:25 PM Table partition in HANA - SAP Community
After partition, we never know which value will go under which partition all partition size will be same. Always make the
partition on fact table and avoid partition on dimension tables to improve the performance of a join between fact table and
dimension table.
Based on collective experience, a generic guideline to follow is to have about 200 million to 800 million rows per partition
Advantage:- Partitioning a table has several advantages. When the data of a table is distributed to multiple nodes over the
landscape, a query against the table will be processed on all these nodes, enabling parallel processing for queries on all
nodes.
There are different types partitioning available in SAP HANA system −
Hash Partitioning
Round Robin Partitioning
Range Partitioning
Hash Partitioning
Hash & Round-robin partitioning do not require an in-depth knowledge of the actual content of the table and primary key
need to define.
Note:- If we create partition on more than one column then need to use both column in where clause during data read form
https://community.sap.com/t5/technology-blogs-by-members/table-partition-in-hana/ba-p/13426395 2/11
10/17/24, 5:25 PM Table partition in HANA - SAP Community
this table otherwise full table scan will be applied and pruning will be lost. The same will goes for missing one column or
having a range condition.
We need to specify at least one column and here partition will be column a & b into 4 partitions.
CREATE COLUMN TABLE TABLENAME (x INT, y INT, z INT, PRIMARY KEY(x,y))
PARTITION BY HASH(x,y) PARTITIONS 4
ALTER TABLE MY_TABLE PARTITION BY HASH (a) PARTITIONS 10;
Round Robin Partitioning
Round-robin partitioning, new rows are assigned to partitions on a rotation basis to achieve an equal distribution.
CREATE COLUMN TABLE TABLENAME (x INT, y INT, z INT)
PARTITION BY ROUNDROBIN PARTITIONS 4
No Primary key is required to define.
Range Partitioning
Dedicated partition on certain values Range partitioning is not well suited for load distribution. Range partitioning - require
an in-depth knowledge of the actual content of the table For example, a range partitioning scheme can be chosen to create
one partition for each calendar month. SAP HANA will only scan the partition where the data of that day resides. This
https://community.sap.com/t5/technology-blogs-by-members/table-partition-in-hana/ba-p/13426395 3/11
10/17/24, 5:25 PM Table partition in HANA - SAP Community
technique is called partition pruning. This data base optimization feature scan only partitions that contain matching values
instead of scanning all partitions, which will improve the performance of result sets.
CREATE COLUMN TABLE TABLE_NAME (x INT, y INT, z INT, PRIMARY KEY (x,y)) PARTITION BY RANGE (x) (PARTITION 1
<= VALUES < 10, PARTITION 10 <= VALUES < 20, PARTITION VALUE = 50, PARTITION OTHERS)
Changing a Table to Add/Drop Rest Partition
ALTER TABLE MY_TABLE ADD PARTITION OTHERS
ALTER TABLE MY_TABLE DROP PARTITION OTHERS
ALTER TABLE MY_TABLE ADD PARTITION (a) 5 <= VALUES < 10
ALTER TABLE MY_TABLE DROP PARTITION (b) 500 <= VALUES < 1000
1 Comment
naimkhan786
Participant
2019 Dec 23 7:56 AM
0 Kudos
https://community.sap.com/t5/technology-blogs-by-members/table-partition-in-hana/ba-p/13426395 4/11
10/17/24, 5:25 PM Table partition in HANA - SAP Community
nice blog
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and
sign in.
Comment
Labels In This Area
"aaMarian_Zeis_is_the_best" 1 "automatische backups" 1 "regelmäßige sicherung" 1 "SAP BW" 2
"SAP VARIANT CONFIGURAITION 2 "SAPDatasphere" 1 "TypeScript" "Development" "FeedBack" 1
3-TIER Extensibility 1 505 Technology Updates53 1 @RetroDate_HireDateCorrection 1 @sapilm @archiving @sapiq 1
A Comprehensive Guide to Using OLE Objects in SAP ABAP 1 aATP 1 ABAP 35 ABAP 7.4 2 ABAP API 1
ABAP CDS VIEW 2 ABAP CDS Views 10 ABAP CDS Views - BW Extraction 3
ABAP CDS Views - CDC (Change Data Capture) 2 ABAP class 2 ABAP Cloud 4 ABAP Cloud Developer Trial 1
ABAP DDIC CDS view 1 ABAP Development 9 ABAP Environment & RAP 2 ABAP Extensibility 2 ABAP in Eclipse 3
ABAP New Syntax 1 ABAP OOABAP 1 ABAP Platform Trial 2 ABAP Programming 6 ABAP Push Channels 1
ABAP Query 1 ABAP RAP 2 ABAP RAP custom action 1 ABAP RAP(RESTful Application Programming) 4
ABAP RESTFul API 1 ABAP RESTful Application Programming Model 2 ABAP String functions 1 abap technical 1
ABAP test cokpit 1 abap to xml 1 abapGit 1 absl 2 Access data from datasphere to ADF Azure Data Factory 2
access data from SAP Datasphere directly from Snowflake 1 Access data from SAP datasphere to Qliksense 1
Accessibility 1 Accessibility in SAPUI5 1 Accrual 1 Acquire SAC Knowledge 2 action 1 actions 1 adapter 2
adapter modules 1 ADDING LEAN SERVICES 2 Addon 2 Adobe Document Services 1 ADS 1 ADS Config 1
https://community.sap.com/t5/technology-blogs-by-members/table-partition-in-hana/ba-p/13426395 5/11
10/17/24, 5:25 PM Table partition in HANA - SAP Community
ADS with ABAP 1 ADS with Java 1 ADT 3 Advance Shipping and Receiving 1 Advanced Event Mesh 4
Advanced formula 1 Advanced SAP Techniques 1 Advanced Scripting in SAC 1 Advanced Workflow 1 AEM 1
AEM Event Portal 1 agile 2 agile development 1 agile teams 1 ai 15 AI Agents 1 AI Essentials 1
ai generated content 1 ai in transportation 1 AI Integration 1 AI Launchpad 3 AI Optimizer 1 AI Projects 2
AI TOOLS 1 aichallenges 1 aicompliance 1 aicreators 1 AIF Logs 1 AIML 11 aimodels 1 aiupdate 1
AL11 1 Alert in Sap analytical cloud 1 alm 1 ALM Nuggets 2 ALV 1 Amazon S3 1 AMDP 3
Analytic Models 1
Related Content
TECH DETAILS - E2E Oracle to SAP HANA Cloud migration with SAP Advanced SQL Migration & SAP HANA SDI
in Technology Blogs by SAP 54m ago
Demystifying Pipeline Explanation for Time Series Data
in Technology Blogs by SAP 3 hours ago
Read \ Write Data between HANA Datalake and HANA On-Prem DB
in Technology Blogs by Members 4 hours ago
Implement Currency Conversion in SAP Datasphere
in Technology Blogs by SAP yesterday
DEMO - E2E Oracle to SAP HANA Cloud migration with SAP Advanced SQL Migration & SAP HANA SDI
in Technology Blogs by SAP Tuesday
https://community.sap.com/t5/technology-blogs-by-members/table-partition-in-hana/ba-p/13426395 6/11
10/17/24, 5:25 PM Table partition in HANA - SAP Community
Popular Blog Posts
SAP PI for Beginners
former_member200339
Participant
715902 153 386
https://community.sap.com/t5/technology-blogs-by-members/table-partition-in-hana/ba-p/13426395 7/11
10/17/24, 5:25 PM Table partition in HANA - SAP Community
ABAP 7.40 Quick Reference
jeffrey_towell2
Explorer
1170259 75 335
https://community.sap.com/t5/technology-blogs-by-members/table-partition-in-hana/ba-p/13426395 8/11
10/17/24, 5:25 PM Table partition in HANA - SAP Community
Fiori: technical installation and configuration of one app from A - Z
mstitsel
Active Participant
201121 133 300
Top Kudoed Authors
https://community.sap.com/t5/technology-blogs-by-members/table-partition-in-hana/ba-p/13426395 9/11
10/17/24, 5:25 PM Table partition in HANA - SAP Community
TrusPatel 7
ManasaManu 6
saikrishna_kalivarapu2 5
MartinRaepple 4
sooriyasudhakar 4
MichalKrawczyk 4
vvdries 4
stephen_xue 3
fredrik_borlie 3
jantuma 3
https://community.sap.com/t5/technology-blogs-by-members/table-partition-in-hana/ba-p/13426395 10/11
10/17/24, 5:25 PM Table partition in HANA - SAP Community
View all
Privacy Terms of Use
Copyright Legal Disclosure
Trademark Support
https://community.sap.com/t5/technology-blogs-by-members/table-partition-in-hana/ba-p/13426395 11/11