Table Partitioning in SAP


When tables grow large, queries on the table will be slow. Index range scans, table scans, backups and restores will be slow. The most common characteristic of such tables is that the older entries in the table are seldom changed and updates happen on the newer entries. By partitioning the table, the older entries can be maintained in a seperate partion, thereby increasing performance--looking up for query results in a smaller set of data, parallel processing in different partitions, faster backups etc.

Types of Partitions:
  1. Range Partition: This allows you to partition data by range of values. Example: 1st partition by column Date: Jan 01 2000 - Dec 31 2005; 2nd partition by column Date: Jan 01 2006 - Dec 31 2010 and 3rd partition by column Date: Jan 01 2011 - Dec 31 2015.
  2. List Partition: This allows you to maintain a list of values that constitute a partition. Ex: 1st partition by Plant: 5000; 2nd partition by Plant:6000.
  3. Hash Partition: A hash algorithm is used to distribute data into different partitions.
  4. Combined Partition: A combination of above three partitions to create partitions and sub-partitions. 

To partition a table in SAP:
  1. Call transaction SE14
  2. Enter the table to be partitioned and click on Edit
  3. Click on Storage Parameters
  4. Click on For new creation
  5. Place the cursor on Table and click Create parameter values (second button) in the toolbar
  6. Choose a template for the parameter values (ex: Current database parameters)
  7. Place the cursor on PARTITION BY and press F4 to select the partitioning method.
  8. Depending on the partition method you choose, some more parameters will populate. You can enter one or more values for these parameters. The values are dependent on the data type and are case-sensitive.
  9. Save the changes
  10. Choose Activate and adjust database to create partitions
If you are interested in learning more about SAP performance, SAP Performance Optimization Guide by Thomas Schneider is a great book.

Comments

Popular posts from this blog

OS/DB Migration - CMD. STR, TOC, EXT, R3load, DDLDBS.TPL and more

Fixing Inconsistent Table - Table activation fails due to inconsistency between DD and DB

301 Redirect Using SAP Web Dispatcher