Professional Documents
Culture Documents
Expert Tips and New Techniques For Optimizing Data Load and Query Performance Part One
Expert Tips and New Techniques For Optimizing Data Load and Query Performance Part One
Techniques for
Optimizing Data Load
and Query
Performance: Part 1
Gary Nolan
Melvan Consulting
© 2006 Wellesley Information Services. All rights reserved.
Overview
2
Performance….
3
What We’ll Cover …
4
What We’ll Cover …
5
Performance Tuning in SAP BW
OLTP
• OLTP systems
Application
Database
development and
performance tuning Application
separate
Performance tuning by Performance tuning
Basis experts SAP BW
Database
Application
6
Performance Tuning in SAP BW (cont.)
OLTP
• OLTP systems
Application development
and performance tuning Database
separate
Performance tuning by Application
Basis experts
SAP BW
SAP BW
Performance must be designed
into the SAP BW solution!
Database
Science vs. Art…
Application
Performance tuning
7
What We’ll Cover …
8
Your SAP BW Performance Checklist
9
Your SAP BW Performance Checklist (cont.)
10
What We’ll Cover …
11
Improving Performance
12
Stay Current on Support Packages
service.sap.com/bi
13
Use Data Modeling Tools – Reporting Needs
Real-time Operational Management Info More Summarized
Inquiry Reporting ? (Lightly Summarized) (More Ad Hoc)
ERP
ERP Characteristics
Characteristics (OLTP)
(OLTP) DW
DW Characteristics
Characteristics (OLAP)
(OLAP)
(Online
(Online transactional
transactional processing)
processing) (Online
(Online analytical
analytical processing)
processing)
14
Use Data Modeling Tools – The BW Data Model
• Consider the data and its storage in your Data Warehouse
(DW) model …
ODS objects and InfoCubes are specifically designed for
certain uses Operational Data Store
• Operational reporting
• Near-real-time/volatile
• Granular ODS
• Built with ODS objects object
16
Use Data Modeling Tools – The InfoCube Model
• SAP extended star schema
Master data is shared, not part of the InfoCube
Master
Master Master
Master
data
data data
data
Dimension
Dimension Dimension
Dimension
Fact Tables
Dimension ID
Dimension
Dimension Dimension
Dimension
For reporting:
Master
Master Should contain only needed Master
data characteristics/key figures. Master
data data
data
Examine alternative data
models and types of KFs.
17
Use Data Modeling Tools – Master Data
• Master data
Hierarchies
Attributes
Master
Texts (multilingual support) Master
SID
SIDtable
table
Data
Data
Hierarchies
Attributes Texts
Plant UK
Customer Street Account Plant Germany
Plant Australia
18
Use Data Modeling Tools – Consider the Level
of Granularity
• Granularity greatly influences:
Reporting capabilities
Performance
Space needed
Load time
• Key questions to ask:
Does the data need to be stored in the cube?
f Storing data in an ODS offers a lower level of
granularity
Does the data need to be stored in the warehouse at all?
f Can you meet users’ drill-down requirements by
linking directly to R/3?
f This would avoid having to load and store the data in
SAP BW
19
Leverage Line-Item Dimensions
SID Dimension Fact table Dimension SID SID Fact table Dimension SID
With Without
line-item line-item
dimension dimension
20
Leverage Line-Item Dimensions (cont.)
• Line-item dimensions
Advantages
f Saves one table join at query runtime (overhead)
• High-cardinality dimensions
Specify high cardinality if the dimension size
exceeds 10 percent of the fact table size
f Converts the index from bitmap to B* Tree for
performance improvement
f InfoCubes can be converted at any time!
22
Leverage Line-Item Dimensions (cont.)
Go to Extras->Partitioning
Tcode
RSA1
24
Database Table Partitioning
• Partitioning
Partitioning splits the table into several tables
This can speed up query performance significantly
The F-Fact table is already partitioned by the request’s ID
The E-Fact table can be partitioned by:
f Calendar year month (0CALMONTH)
25
Database Table Partitioning (cont.)
• Benefits
Parallel accesses to partitions
Read smaller sets of data
26
MultiProvider Partitioning
• MultiProvider (logical) partitioning
Can partition data by year, plan/actual, region, business area, etc.
Parallel sub-queries are started automatically to basic InfoCubes
Use to divide large amounts of data into “chunks”
Consolidated view
on all data
Basic
InfoCubes
F-Fact table E-Fact table F-Fact table E-Fact table F-Fact table E-Fact table
Req-id 001/2002 Req-id 001/2002 Req-id 001/2002
Req-id 002/2002 Req-id 002/2002 Req-id 002/2002
Physical Req-id 003/2002 Req-id 003/2002 Req-id 003/2002
partitions …. …. ….
012/2005 012/2005 012/2005
27
MultiProvider Partitioning (cont.)
• Benefits
Queries are split automatically and distributed to
InfoProviders (parallel execution where possible)
Single InfoProviders are smaller, less complex, and less
sparsely filled than one big InfoProvider
No additional data storage needed
Individual InfoProviders can be tuned independently
Data can be loaded into individual InfoProviders
in parallel
Transparent use for reporting to query designers and
end users
Local queries on each InfoProvider possible
Archiving of single basic InfoProvider is very easy
28
MultiProvider Partitioning (cont.)
• Disadvantages
Administration (with aggregates)
Additional I/O
29
What We’ll Cover …
30
Use Time-Dependent Master Data Carefully
31
Use Time-Dependent Master Data Carefully (cont.)
32
InfoCube Compression
33
InfoCube Compression (cont.)
Compression can be executed during query execution and
data loading
f Transparent to end users and data consistency
is guaranteed
Dat
a lo
ads
F Table
REQUEST No. Time Material Sales
Fact
FactTables
Tables
E Table
Compression
2
REQUEST No. Time Material Sales
34
InfoCube Compression (cont.)
35
Compression and Non-Cumulative Key Figures
• Non-cumulative key figures
Cannot be cumulated meaningfully over time
f e.g., inventory, number of employees
Storage: Historical movements and reference point
(in E-Fact table)
Reference point is updated only when InfoCube is compressed
f If all requests are compressed, the reference point represents, e.g., the
current stock
f If not, then all request IDs have to be analyzed to determine correct
value
Example:
F-Fact table E-Fact table
Month Material Plant Material flow Reference point
Jan-02 4711 1000 10 0
Compressing 10
Feb-02 4711 1000 20 10
Mar 02 4711 1000 5 10
Compressing 35
Note: The reference points are stored only in the compressed E table;
they have the time value “infinity,” e.g., for day 12/31/9999 36
Symptoms of Many Uncompressed InfoCube Requests
• Data staging:
Index builds after data loads become slower
DB statistics after data loads become slower
Aggregate builds encounter long runtimes or errors
Data availability for querying on new requests data is affected
• Query execution:
Queries become slower and slower with each data load
Queries on non-cumulative InfoCubes are very slow
37
Master Data Range Buffering
• SID generation/allocation can become a bottleneck
when loading master data (or transaction data that
generates master data)
SID number range can be buffered instead of accessing the DB for
each SID
If you discover massive accesses to DB table NRIV via SQL trace
(ST05), increase the number range buffer in transaction SNRO
If possible, reset the value to its original state after the load (to avoid
unnecessary memory allocation)
SID Material Number
SID Buffer
1 4711 See the
4
2 0815 BW Expert
5
3 4712 6
article:
Increase Load
7 Performance by
8 Buffering
Number Ranges
Select next new
SID from buffer
New material: 1125
SID
38
Change Run/Apply Job
39
Change Run/Apply Job (cont.)
40
Change Run Performance – Tips
41
InfoCube Data Load Performance
• Admin WB > Modeling > InfoCube > Manage > Performance Tab
• Recommendation: Drop secondary indexes prior to large
InfoCube data loads
• Can be done using process chains in BW 3.x
42
Load Performance – Index Management
43
Load Performance – Load Packet Size
44
Load Sequencing
45
ODS Load/Activation Tuning Tips
Non-reporting ODS objects
BEx flag: Computation of
SIDs for the ODS can be
switched off
Loads are faster as master data SID tables do not have to be read
and linked to the ODS data
46
Flat File Load Performance
• Filters
Build secondary indexes on filtered fields in source system
• Convert old LIS extractors to V3 collection method
More efficient loads
• Use delta processing whenever possible
• Run loads at off-peak times
• Ensure that the selection parameters of the extraction
InfoPackage facilitate the use of indexes
You can use transaction RSRV to check indexes
48
Other Performance Tuning Tips (cont.)
49
What We’ll Cover …
50
Methods for Determining Bottlenecks
51
Methods for Determining Bottlenecks (cont.)
52
Transaction SE30 – Runtime Analysis
53
Is Extraction Time Too Long?
Check SQL
54
Simulate Update
• Debugging and tuning update and transfer rules:
Allows ABAP single step using breakpoints to
determine bottlenecks
55
What We’ll Cover …
56
Resources
service.sap.com/bi (Requires login credentials to the SAP Service Marketplace)
Performance
57
Resources (cont.)
• BW Expert Articles:
“Better Star Schema Design Means Better Performance,”
by Gary Nolan, (Volume 2, Issue 8)
“Data Modeling with Time-Dependent Master Data,”
by Gary Nolan, (Volume 2, Issue 4)
“InfoProvider Compression: What It Is and When to Do It,”
by Gary Nolan, (Volume 3, Issue 5)
“24 BW Design and Data Modeling Tips for Optimal ETL,”
by Catherine Roze and Joffy Mathew, (Volume 1, Issue 9)
“Debug Routines in Update Rules in Just Seven Easy Steps,”
by July Hartono, (Volume 1, Issue 2)
58
7 Key Points to Take Home