DB2@SAP Deep Compression
DB2@SAP Deep Compression
COMPRESS YES
2) LOAD
Or, ALTER <existing
table>
COMPRESS YES
Or, IMPORT,
INSERT,
IBM DB2 and SAP
2008 IBM Corporation 13
1.8.2 Automatic (Compression) Dictionary Creation (ADC) V9.5
Row Compression supports now Automatic Compression Dictionary
Creation (ADC)
Table compress attribute must be set
Synchronous dictionary creation when table data reaches a certain threshold (appr. 1 MB
system default)
Once the dictionary is created new data will be inserted in compressed format
Works regardless of growth mechanism
INSERT
IMPORT
LOAD
REDISTRIBUTE
No need to worry about creating compression dictionary occurs automatically when data
threshold is reached
No lengthy offline reorg operation required to enable compression
Tradeoffs
Compression ratio depends on the first one MB of data
Depending how representative the first MB of data is, the compression ratio less than
optimal
Slight performance hiccup incurred when threshold is crossed. The transaction which
needs to create the dictionary must pay the cost of creating the dictionary.
IBM DB2 and SAP
2008 IBM Corporation 14
1.8.3 Automatic (Compression) Dictionary Creation (ADC) V9.5
1) CREATE
COMPRESS YES
Once threshold is
reached, dictionary
built automatically,
and subsequent rows
compressed
2) LOAD
Or, IMPORT,
INSERT,
Internal threshold
designed as best
compromise b/w
compression ratio, and
dictionary build speed.
Default ~1 MB
Dictionary
Dictionary
IBM DB2 and SAP
2008 IBM Corporation 15
1.9 SAP Support for Deep Compression Overview
Fully Integrated into DBACockpit (NW 7.0 SP12)
Separate Compression Tool for
Monitoring table sizes
Estimating compression disk space savings
Enabling deep compression
Scheduling INSPECT or offline REORG
SAP Note 980067 Using DB2 9 Row Compression
Description and set of SQL scripts and tools for finding deep compression
candidate tables and enabling compression
SAP Note 905614 R3load support for data row compression
IBM DB2 and SAP
2008 IBM Corporation 16
1.10 NetWeaver 2007 Support Compression Check
IBM DB2 and SAP
2008 IBM Corporation 17
1.11 NetWeaver 2007 Support - Compression Enabling
IBM DB2 and SAP
2008 IBM Corporation 18
1.12 Compression Tool in SAP Note 980067 (1)
For use with 4.6C NW2004s
Tool attached to SAP Note rowcompression.zip
Install tool as an SAP transport
Call compression tool program /ISIS/ZCOMP from transaction SE38
Empty list
IBM DB2 and SAP
2008 IBM Corporation 19
The first step is to get a list of tables that are candidates for compression. The
candidates are selected using the following criteria:
20 largest tables (excluding LOBs) in the system which are:
Not compressed
Not volatile
Do not belong to a SAP cluster or pool table, or DB2 index only table
The row size is larger than the minimum row size for the tablespace page size
Schedule the job
1.13 Compression Tool in SAP Note 980067 (2)
IBM DB2 and SAP
2008 IBM Corporation 20
Candidates identified and listed under the Candidates tab
Select table first
1.14 Compression Tool in SAP Note 980067 (3)
IBM DB2 and SAP
2008 IBM Corporation 21
After tables have been compressed, they are listed under the Compressed tab
1.15 Compression Tool in SAP Note 980067 (4)
IBM DB2 and SAP
2008 IBM Corporation 22
1.16 Deep Compression Support in SAP BW
Special support for SAP BW
SAP Note 906765 - DB2 9 data row compression for SAP BW 3.x
SAP BW 3.0 SP 33, SAP BW 3.1 SP 27, SAP BW 3.5 (SAP NetWeaver 04) SP 19
SAP Note 926919 DB2 9 data row compression for SAP NetWeaver BI 2004s
SAP NetWeaver BI 2004s Support Package (SP) 9
Configuration parameter DB6_ROW_COMPRESSION
When set to YES, PSA, DataStore and Fact tables are created with deep
compression enabled. Use report SAP_RSADMIN_MAINTAIN to set the
parameter
After one or more InfoPackages have been loaded into the tables an
offline REORG or INSPECT is required to create the compression
dictionary
Transaction RSRV offers 2 new tests for checking whether a
compression dictionary exists for SAP NetWeaver BI tables that have
deep compression enabled
Check Deep Compression for InfoProvider tables in DB2
Check Deep Compression for PSA tables in DB2
IBM DB2 and SAP
2008 IBM Corporation 23
1.17 BW Tables Deep Compression Check in Transaction
RSRV
Call transaction
RSRV
Select test
Check deep
compression of
database tables
of InfoProviders
in DB2/UDB or
Check deep
compression of
PSA database
tables in
DB2/UDB
IBM DB2 and SAP
2008 IBM Corporation 24
1.18 To Enable Deep Compression for BW Tables
Select offline
REORG or
INSPECT for
tables
chosen for
compression
IBM DB2 and SAP
2008 IBM Corporation 25
1.19 Customer 1 Experience
Compression test on a real customer BW database
a) Total db size (over all partitions): 3.356 TB
b) Total used space (over all partitions): 2.873 TB
c) Total free space (over all partitions): 480 GB
d) Data Tablespaces with tables, which will be compressed:
Total size: 2.398 TB used: 2.029 TB Free: 0.367 TB
e) Index Tablespaces, which will not be compressed:
Total size: 0.781 TB used: 0.689 TB Free: 0.091 TB
g) Data and Index Tablespaces, which will be not compressed:
Total size: 0.177 TB used: 0.155 TB Free: 0.022 TB
Database size reduced from 2.873TB to 1.453TB (50%)
169 72.8% 6.32 23.24 39573969 10 /BIC/B0000285000
172 66.9% 8.54 25.78 23370458 10 /BIC/B0000326000
43 74.2% 3.05 11.80 19474261 20 /BIC/AZOSDBL0100
105 74.4% 36.18 141.46 191362309 100 /BIC/AZOSDOR0200
162 75.7% 5.23 21.48 77390826 10 /BIC/FZBSDOR02
58 81.5% 13.23 71.49 159259747 100 /BI0/F0PUR_C01
Total Estimated
Disk
Savings
(GB)
Compressio
n ratio
(%)
Sample
Compressed
size (GB)
Sample size
(GB)
Number of
rows
% of
original
table
Table name
IBM DB2 and SAP
2008 IBM Corporation 26
1.20 Customer 2 Experience INTER Versicherung
(Germany)
SAP R/3 4.7 with IS Insurance.
DB size:
Overall DB size (used) uncompressed: 266 GB
Overall DB size (used) compressed: 151 GB (43 % savings)
Compressed size includes larger index sizes due to large RID conversion (for all the tables that were
compressed and therefore reorganized)
SAP note #980067 used to identify tables for compression - 310 tables, shrinking from 132,5 GB to
39,7 GB (70 %)
Perfomance behaviour:
During two weeks of production
Dialog response time for their 30 most important transactions went down from 285 ms average to
198 ms average (30% improvement).
Dialog response time for all transactions went down from 247 ms average to 183 ms average
(26% improvement).
There was also an improvement for batch jobs.
They pay a slight CPU penalty. CPU user time went from 18,3 % average to 19,6 %
average (+ 5%) ... they for sure never had a CPU bottleneck
No performance problems before, overall they ran a well balanced system
IBM DB2 and SAP
2008 IBM Corporation 27
1.21 Customer 2 Experience INTER Versicherung
(Germany)
Week 46 database uncompressed
Week 47 database compressed
Through monitoring the SAP system performance for these two weeks, we can
conclude:
The overall response time had improved by over 23%, for both Dialog and Batch transaction.
The main contributor was the reduced database response time.
For Dialog transactions, bigger throughput was achieved, and with less CPU
For Batch transactions, CPU usage was up by 22.3%
IBM DB2 and SAP
2008 IBM Corporation 28
1.22 Customer 3 Experience - SAP BI PoC Unnamed
customer
PoC done on a customers 20TB database and workload
p595 and DS8300 storage
Total DB reduced from 16TB to 8TB (used pages)
Average Compression Rate
ODS 79% (26 tables)
PSA 64% (517 tables)
Fact 86% (100 tables)
Average Query Times
Transactions/sec 1.39 to 1.44 (3.5%)
Response (sec) 10.6 to 7.12 (23%)
IBM DB2 and SAP
2008 IBM Corporation 29
1.23 Backup Compression and Data Row Compression
Test backup compression in addition to tables with row compression
Backup compression can be expensive and may not provide much added value in
additional savings to backup image size
Time/size/value depends on the percentage of table space content with row compression.
E.g. Are all tables compressed? Are indexes or long data stored in the same table space?
662
198
1028
468
Total User Time
(seconds)
610816
610816
1510400
1510400
Pages Used
4.68
4.68
11.57
11.57
Table Space
Size (GB)
4.2
4.7
4.2
12
Backup Image
Size (GB)
Data Row and
Backup
Compression
Data Row
Compression Only
Backup
Compression Only
No compression
Scenario
IBM DB2 and SAP
2008 IBM Corporation 30
THANK YOU
FOR YOUR ATTENTI ON !
QUESTI ONS SUGGESTI ONS DI SCUSSI ON