Sei sulla pagina 1di 62

Keep Learning with Oracle

University
Classroom
Training

Cloud

Learning

Technology

Subscription

Applications

Live Virtual Class

Industries

Training On
Demand

education.oracle.
Copyright 2015, Oracle and/or its affiliates. All rights reserved.
Oracle
|
Confidential Internal

Session Surveys
Help us help you!!
We invite you to take a moment to give us your session
feedback. Your feedback will help us to improve your
conference.
Please be sure to add your feedback for your attended
sessions by using the Mobile Survey or in Schedule Builder.

Oracle Confidential Internal/Restricted/Highly


Copyright 2015, Oracle and/or its affiliates. All rights reserved. |
Restricted

OBIEE Performance and RPD


Optimization techniques
Deb Bhattacharjee
Anupam Bordia
Lionel Hsu
Oracle, Performance team
October 29, 2015

Oracle Confidential Internal/Restricted/Highly


Copyright 2014,
2015, Oracle and/or its affiliates. All rights reserved. |
Restricted

Safe Harbor Statement


The following is intended to outline our general product direction. It is
intended for information purposes only, and may not be incorporated
into any contract. It is not a commitment to deliver any material, code,
or functionality, and should not be relied upon in making purchasing
decisions. The development, release, and timing of any features or
functionality described for Oracles products remains at the sole
discretion of Oracle.

Oracle Confidential Internal/Restricted/Highly


Copyright 2015, Oracle and/or its affiliates. All rights reserved. |
Restricted

Program Agenda
1

BI Mashup Performance Optimizations

Best practices

Aggregate persistence

Caching

Case studies
Q&A
Copyright 2015, Oracle and/or its affiliates. All rights reserved.
Oracle
|
Confidential Internal

Prerequisites

Good understanding of OBIEE architecture


Some understanding of FA (Fusion Application) BI
Integration

Copyright 2015, Oracle and/or its affiliates. All rights reserved.


Oracle
|
Confidential Internal

Program Agenda
1

BI Mashup Performance Optimizations

Best practices

Aggregate persistence

Caching

Case studies
Q&A
Copyright 2015, Oracle and/or its affiliates. All rights reserved.
Oracle
|
Confidential Internal

BI Mashup
What is BI Mashup?
Extends the data model to
include ad-hoc dimensions
and facts from Excel.
Dimensions extensions to add new
attributes
Fact extensions to add new
metrics

Copyright 2015, Oracle and/or its affiliates. All rights reserved.


Oracle
|
Confidential Internal

BI Mashup Example

Copyright 2015, Oracle and/or its affiliates. All rights reserved.


Oracle
|
Confidential Internal

10

BI Mashup Performance Optimizations


New Optimizations for Mashup
File-based XSA caching to make fetching dataset faster
DB-based XSA caching to make fetching dataset faster
Aggregate Sort in OBIS engine to make sort faster

Copyright 2015, Oracle and/or its affiliates. All rights reserved.


Oracle
|
Confidential Internal

11

XSA best practice(I)


Be careful on picking
columns in the report and
avoid cross-joins
In the example on the
right, Customer and the
Hours Spent have no
relationship to join them
together and hence a
cross-join.
[2015-09-18T18:42:05.640-07:00]
[OBIS] [TRACE:4] [] [] [ecid: d016f6a9b10d-4d90-86ec-4902eaca81a50003fdae,0:1:9] [sik: service1] [tid:
2cfa2710] [messageid: USER-69]
[requestid: 4ca90052] [sessionid:
4ca90000] [username: weblogic]
-------------------- Number of joins
executed internally for this logical
request hash 53127482 : 2,number of
sort merge join 2, number of hash join
0, number of pnlj join 0 , number of full
outer join 1, number of left outer join 0,

Copyright 2015, Oracle and/or its affiliates. All rights reserved.


Oracle
|
Confidential Internal

12

XSA best practice (II)


In the example on the right, P1
Product and the Hours Spent have
relationship to join them
together and hence full outer
join and left outer join were
used.
[2015-09-18T18:49:01.534-07:00] [OBIS]
[TRACE:4] [] [] [ecid: d016f6a9-b10d-4d9086ec-4902eaca81a5-0003fefc,0:1:18] [sik:
service1] [tid: 2be32710] [messageid: USER69] [requestid: 4ca90073] [sessionid:
4ca90000] [username: weblogic]
-------------------- Number of joins executed
internally for this logical request hash
2d12c916 : 2,number of sort merge join 2,
number of hash join 0, number of pnlj join 0 ,
number of full outer join 1, number of left
outer join 1, number of inner join 0, number
of cross join 0
Copyright 2015, Oracle and/or its affiliates. All rights reserved.
Oracle
|
Confidential Internal

13

Program Agenda
1

BI Mashup Performance Optimizations

Best practices

Aggregate persistence

Caching

Case studies
Q&A
Copyright 2015, Oracle and/or its affiliates. All rights reserved.
Oracle
|
Confidential Internal

14

Query governor Global


How do I prevent a BI Query from running more than 20
minutes and consuming most of the CPU?
How do I prevent a BI Query from fetching more than a
million rows?
Order of precedence:
Global setting
Role based
Session based

Global setting in NQSConfig.ini:


DEFAULT_DB_MAXEXECTIME=600;
DEFAULT_DB_MAXROWS=100000;

# in seconds
# number of rows

OBIS_NQSCONFIG_QUERY_LIMITS_AS_GLOBAL_MAXIMUM =
1; #prevents rpd to overwrite global maxima
Copyright 2015, Oracle and/or its affiliates. All rights reserved.
Oracle
|
Confidential Internal

15

Query governor Role based


Maximum governing value of
all the available roles assigned
to user
To set, one can open user/role
in AdminTool and set Max rows
fetched or time after which
query should be aborted if not
completed.
Manage -> Identity ->
Application Roles ->
Permissions -> Query Limits
Terminates query if it exceeds
10 minutes (not including fetch

Copyright 2015, Oracle and/or its affiliates. All rights reserved. |

Oracle Confidential Internal

16

Query governor Session based


Set below variables in query:
OBIS_DB_MAXEXECTIME
OBIS_DB_MAXROWS
SET VARIABLE OBIS_DB_MAXEXECTIME=60, OBIS_DB_MAXROWS=100000: SELECT

Copyright 2015, Oracle and/or its affiliates. All rights reserved.


Oracle
|
Confidential Internal

17

Compatibility flag
A single COMPATIBLE_RELEASE flag
can be set to restore all the
compatibility flags to the default
values as of a particular earlier
release
Earliest release that will be
recognized by the framework is
11.1.1.9
Set compatibility flags on a systemwide basis in the NQSConfig.INI
(needs OBIS restart) or for a
particular report as request
variables without changing the RPD
or bouncing server
Copyright 2015, Oracle and/or its affiliates. All rights reserved.Oracle
|
Confidential Internal

18

Pushing individual db features into


specific queries
Ability to specify DB Features during report execution w/o changing
RPD or OBIS restart
DB feature override variables will take the form of
OBIS_DBFEATURES_<PhysicalDatabaseName>_<DBFeatureName>.
Any special characters in the physical database name such as spaces
or underscores will just be included as is in the variable name.
SET VARIABLE "OBIS_DBFEATURES_Oracle Data
Warehouse_DEFAULT_BULK_FETCH_ROW_COUNT" = 1000:
SELECT ...
DBFeatures.INI will move to ORACLE_HOME
Copyright 2015, Oracle and/or its affiliates. All rights reserved.
Oracle
|
Confidential Internal

19

DB Fetch Row Count


To optimize database fetch
across high latency network
DEFAULT_BULK_FETCH_ROW_COU
NT increase to 1000 from default
of 100.
Number of rows will be adjusted
based on the predicted length of
the row. predicted_row_length *
DEFAULT_BULK_FETCH_ROW_COU
NT is bounded by
{MIN/MAX}_BULK_FETCH_BUFFER
_SIZE
Only exception when single row

Copyright 2015, Oracle and/or its affiliates. All rights reserved.


Oracle
|
Confidential Internal

20

Init Block - Defer


Check if session init blocks
are deferred:
Earlier row-wise init blocks
could not be deferred
Non deferred session init block
are executed at each login
delaying login
Almost all of the session init
blocks should be deferred.
Allow deferred execution
should be selected

Copyright 2015, Oracle and/or its affiliates. All rights reserved.


Oracle
|
Confidential Internal

21

SQL Bypass

SQL-bypass is the recommended


approach for OTBI reports

Ensure all ADF queries are executed in


SQL-bypass mode
To verify, check nqquery.log for:
<ADFQuery mode="SQLBypass"
queryid="26500-19169"
locale="en">
<ADFQuery queryid="26500-19169"
locale="en"> # not using sql
bypass

System would be slow if missing sqlbypass database


50x improvement observed if sqlbypass is used
Avoid projecting transient attributes,
this results in BI-ADF broker skipping
Copyright 2015, Oracle and/or its affiliates. All rights reserved.
Oracle
|
Confidential Internal
sql-bypass mode and hence queries

22

OBIS Query logs


In RPD, set session variable
LOGLEVEL between 0 (no logging)-7
(extensive logging)
2 is recommended (on production)
to get the logical and physical sqls
from the query logs, this setting has
minimal performance impact
For detailed logging (not
recommended for production
instance), add variables
<variable id="LOGLEVEL" value="7"/>
<variable
id="NQUIRE_INTERNAL_LOGGING"
value="1"/>
under <ias-component
id="coreapplication_obis1"Copyright
inherit 2015, Oracle and/or its affiliates. All rights reserved. |

Oracle Confidential Internal

23

OBIS Server logs


Set system log level to 3 (to be set
only during diagnostics)
Helps debugging issues related to init
blocks
Time taken by LDAP server to
authenticate
Time taken by each init block to
execute
Example:
User '
bi.openworld@oracle.com '
spent 14.000000 milliseconds
getting http response when
'getAuthenticatedUserWithLangu
ageAndProperties'.
User bi.openworld@oracle.com'

Copyright 2015, Oracle and/or its affiliates. All rights reserved. |

Oracle Confidential Internal

24

OBIS
Logs
Setup
Enterprise
Manager
(EM)
Log level of various BI components can be changed via
EM.
Ensure that parameter centralConfigurationEnabled is
set to true in
file:~user_projects/domains/bifoundation_domain/config
/fmwconfig/biee-domain.xml
Trace
Level in
logconfig.
xml
1
16
32

BI Server
Log Level
2
5
7

Copyright 2015, Oracle and/or its affiliates. All rights reserved.


Oracle
|
Confidential Internal

25

OBIS Log inspection


Line/Hash value after SQL Request denotes logical hash
value for the query
-------------------- SQL Request, logical request hash:
42909950
SET VARIABLE LOGLEVEL=7:SELECT, "Fact - Sales Invoice Lines"."Gross Sales
FROM "Sales

Message to check if query is cacheable or not:


The logical query block fail to hits or seed the cache in subrequest level
due to session variable or config file disable subrequest cache

Use Query log to verify cache hit:


----------------- The logical query hits the plan cache, plan

Copyright 2015, Oracle and/or its affiliates. All rights reserved.


Oracle
|
Confidential Internal

26

OBIS Log inspection


Find NQServer Execution plan (Do not confuse with SQL
execution plan):
------------------- Execution plan:

ADF query executed in bypass mode:


<ADFQuery mode="SQLBypass" queryid="26500-19169" locale="en">
SQLBypass mode is skipped if a transient attribute is being used in query

Physical (Database) SQL Request:


Physical query follows statement where query is being sent to physical
datasource, Oracle Data Warehouse Connection in this case. Logical and
Physical hash values are highlighted
Sending query to database named Oracle Data Warehouse (id: <<270614>>),
connection pool named Oracle Data Warehouse Connection Pool, logical
request hash 42909950, physical request hash 8245d55b:
Copyright 2015, Oracle and/or its affiliates. All rights reserved.
Oracle
|
Confidential Internal

27

OBIS Log inspection


Query Status
Query Status: Successful Completion

Find number of rows returned by DB to NQServer:


Execution Node: <<27109>> DbGateway Exchange, Close Row Count = 11, Row
Width = 64 bytes

Find response time for physical query execution:


Physical query response time 1.898 (seconds), id <<270614>>

Copyright 2015, Oracle and/or its affiliates. All rights reserved.


Oracle
|
Confidential Internal

28

OBIS Log inspection


Find summary stats for physical and logical query execution:
Physical Query Summary Stats: Number of physical queries 1, Cumulative time
1.905, DB-connect time 0.000 (seconds)
Logical Query Summary Stats: Elapsed time 2.305, Response time 2.304,
Compilation time 0.398 (seconds), Logical hash 42909950

Tie physical sql from nqquery.log to ORDBMS using physical hash value
Physical hash value is propagated to ORDBMS during query execution (it gets stored in
action.v$sql)
select * from v$sql where action = 'c8dc78e8

Copyright 2015, Oracle and/or its affiliates. All rights reserved.


Oracle
|
Confidential Internal

29

OBIS Log inspection


If you see sporadic slowness. Check for logs in OBIS / OBIPS for any
I/O issue.
I/O op > 5sec are now logged as WARNING.
Operations being tracked: open/ close/ read/ write/ flush/ getsize/
setsize/ seek etc
Sample log entries: 6.0 seconds were spent during file creation.
For every execution node, the temp file usage is logged as.
Execution Node for logical request hash ab651f95 : <<40088>>, Close Row
Count = 9, Row Width = 56 bytes, Temporary file size = 0 bytes
At the end of logical query, the information is printed:
-------- Number of temp files generated internally for this logical sql
hash bdf1624 : 1 . Temporarily file info: type: AG, total number of
files 1, total bytes 11234. file
AG
. All rights reserved.Oracle
Copyright info:
2015, Oracle and/or
its affiliates.
|
Confidential Internal
30

Configurations for better performance


inspection
Parallel init block execution
NUM_INIT_BLOCK_THREADS_PER_USER

Parallel ADF VO query fetching


ADF_SQL_BYPASS_THREAD_RANGE

Recommend to set to same value as DB_GATEWAY_THREAD_RANGE.

Based on your workload, thread pools needs to be adjusted to


capitalize on these features.
Limit login timeout (in seconds)
MAX_AUTHENTICATION_TIME = 120
INIT_BLOCK_LOG_TIME_THRESHOLD = 60

Copyright 2015, Oracle and/or its affiliates. All rights reserved.


Oracle
|
Confidential Internal

31

Auto Incident Generation on Slow


Requests
Configure a WLS server to automatically generate an incident
when slow requests are detected.
Incident can contain JFR recording and other useful dumps when
slow requests are detected.
Incident can be generated periodically or on each occurrence
Related links:
http://docs.oracle.com/cd/E48434_01/fusionapps.1118/e16686/mp_entmgr.htm
(Using Automatic Incident to Capture Diagnostic Information for Slow Requests)
http://aseng-wiki.us.oracle.com/asengwiki/display/ATG/Auto+Incident+Generation+on+Slo
Copyright 2015, Oracle and/or its affiliates. All rights reserved.
Oracle
|
Confidential Internal
32
w+Requests

OBIS temp file compression


Temp file enhanced naming convention for better diagnosability:
nQS_<pid>_<serverid>_<componentid>_<requested>_<fileid>_<timestamp>.tmp
componentid can be: ST Sort, AG Aggregate table,EX - Exchange,LG- Log
viewer,AM Admintool related operations,SC Security related,GW Gateway related
Enable in-memory compression (uses zlib)
Better log message to triage temp file issues
Configurations:
WORK_DIRECTORY_PATHS = "temp1" [<Size>] [,"temp2" [<Size>], "temp3
[ <Size>]];
WORK_DIRECTORY_SIZE_GLOBAL_LIMIT = ""; /*default 100G */ all of the temp file cant
exceed this
number.
MAX_TEMPORARYFILE_RATIO= ; /*default 0.2 */ Max size single file can grow,
compared to global
limit. Ex, if global limit s 100GB, ratio is 0.2, temp file cannot
exceed 200 MB
ENABLE_COLUMNAR_STORAGE_FOR_WORK_FILE=YES;
true
*/ Internal
Copyright 2015, Oracle and/or its affiliates. All/*default
rights reserved.
Oracle
|
Confidential

33

Program Agenda
1

BI Mashup Performance Optimizations

Best practices

Aggregate persistence

Caching

Case studies
Q&A
Copyright 2015, Oracle and/or its affiliates. All rights reserved.
Oracle
|
Confidential Internal

34

What Makes Queries Run Slowly?


Large Causes
table

Problem

Scanning too many


records on the disk

Complex transformations

Returning too many


records over the network

Unsupported DB function

Interface & processing


bottlenecks

Too many joins/ poor SQL

Cross-DB join of large


table
Poor prompt design/
poor SQL
Connection pool settings
Logging
Configuration settings
Insufficient hardware

Copyright 2015, Oracle and/or its affiliates. All rights reserved. |

Why Aggregates?
Pros
Faster query response time usually by several order of magnitude
Efficient resource utilization
Aggregates can be in the same database as the source
Aggregates can be on a different relational source or Essbase

Cons
Creating aggregates is a resource intense exercise
Cannot be used for real time data

Copyright 2015, Oracle and/or its affiliates. All rights reserved. |

Oracle BI EE Architecture
Semantic
Layer
Metadata

SQ
L

BI Server

Tables

RDBMS
Copyright 2015, Oracle and/or its affiliates. All rights reserved. |

Aggregates
Semantic
Layer
Metadata

BI Server

Detail

SQL

At query time, BI Server queries


the fastest source that has enough
detail to satisfy the user request

SQ
L

Metadata
describes
aggregate
mappings

Performance of highly summarized


requests is dramatically improved

Summary aggregates
ation
g
e
r
agg
e
m
ti
Load

RDBMS
Copyright 2015, Oracle and/or its affiliates. All rights reserved. |

Aggregates can
reside in a
different database

Steps using Admin Tool


1
3

Design aggregate facts and grains

Target database for create/load

Wizard to create metadata

Copyright 2015, Oracle and/or its affiliates. All rights reserved. |

Program Agenda
1

BI Mashup Performance Optimizations

Best practices

Aggregate persistence

Caching

Case studies
Q&A
Copyright 2015, Oracle and/or its affiliates. All rights reserved.
Oracle
|
Confidential Internal

40

Query Plan Cache


Saves CPU processing time by avoiding recompiling SQL
MAX_QUERY_PLAN_CACHE_ENTRIES # recommended value 1024
MAX_QUERY_PLAN_CACHE_ENTRY_SIZE # recommended 1 MB

Does not persist during server restart


Check query logs if query is being seeded in plan cache
The logical query seeds the plan cache

Check available RAM on the server and adjust above two


parameters for your workload
Check compilation time from query logs
Logical Query Summary Stats: Elapsed time 9.958, Response
time 9.958, Compilation time 0.956

Copyright 2015, Oracle and/or its affiliates. All rights reserved.


Oracle
|
Confidential Internal

41

Result Cache
Logical query results are cached by the server
Parameters to control number of rows per cache as well as
number of cache entries allowed
[CACHE]
ENABLE = NO;
MAX_ROWS_PER_CACHE_ENTRY = 100000;
MAX_CACHE_ENTRY_SIZE = 20 MB;
MAX_CACHE_ENTRIES = 1000;

Performance boost for repeating queries

Shared dashboards normally get high hit rates


Ad hoc and highly dynamic use cases have high miss rate
Not a substitute for database tuning and aggregation

Cached results are automatically shared by users with similar


security
Copyright 2015, Oracle and/or its affiliates. All rights reserved.
Oracle
|
Confidential Internal

42

Result Cache
Table level control (i.e., dont cache real-time tables)
Use Cache Manager in Admin Tool (in online mode) to gather
cache hit and miss number
You need to define seeding and purge strategy
Cache is persistent during server restart
May not be compatible from release to release, needs to be
seeded after patching

Copyright 2015, Oracle and/or its affiliates. All rights reserved.


Oracle
|
Confidential Internal

43

Cache Statistics (programmatic)


OBISAvailableDiagnostics();
Lists all caches, result as well as plan cache

OBISDiagnostics($Name_of_cache_from_above_step')
Result cache statistics parameter list:
QUERIES PER SEC
FAILED QUERIES PER SEC
NEW PREPARES
ROWS PER SEC
KB PER SEC
Plan cache statistics parameter list:
CAPACITY
TOTAL REQUESTS
AVG REQUESTS
AVG HITS
AVG MISS
Copyright 2015, Oracle and/or its affiliates. All rights reserved.
Oracle
|
Confidential Internal

44

Cache Hits
Caching is at the logical query layer, not physical layer
A query doesnt need to be identical to get a hit
Cache results can be aggregated to satisfy a request
A more restrictive WHERE clause can hit
A subset of columns will hit
Expressions can hit if they use only cached columns
Cache entry currently contains
Database tables
Database Schemas
Connection pool parameters
Connection scripts
Physical Plan
Session variables (name/value) included in the plan
Cache detector will not hit if the above variable values does not match for
incoming query
Copyright 2015, Oracle and/or its affiliates. All rights reserved.
Oracle
|
Confidential Internal

45

Cache Strategy - Purge

Purge to avoid stale data inconsistent with source


Event Polling Tables allow integration with ETL
Timed purges
Manual purges
Programmatic purges via SQL calls
Purge plan cache, nqSQL Statement: call sapurgeplancache();
Purge data cache, nqSQL Statement: call sapurgeallcache();

Copyright 2015, Oracle and/or its affiliates. All rights reserved.


Oracle
|
Confidential Internal

46

Cache Strategy - Seeding

Seeding ensures good performance for the first users of the day
iBots can run standard dashboards to seed them
Run seed queries that are easy to hit (see Admin Guide)
Simple columns (no expressions)
No WHERE clause

Copyright 2015, Oracle and/or its affiliates. All rights reserved.


Oracle
|
Confidential Internal

47

Advanced Hit Detection


Multiple passes for more cache hits results in additional CPU usage
NQSConfig.INI Settings
USE_ADVANCED_HIT_DETECTION = YES;

Consider the following 3 queries


Q1: SELECT Markets.Region, Markets.District, Markets.Market, Products.Brand,
Periods."Year", "Sales Measures".Dollars FROM
Paint
WHERE Periods."Year" IN ('1998', '1999')
Q2: SELECT Markets.District, Products.Brand, Periods."Year", "Sales
Measures".Dollars
FROM
Paint WHERE Periods."Year" = '2000'
Q3:SELECT Markets.District, Products.Brand, Periods."Year", "Sales
Measures".Dollars
FROM
Paint WHERE Periods."Year" = '1998
Q1 is cached; Q3 gets a cache-hit from Q1 with aggregate-rewrite;
Q1 and Q2 is cached; Q3 now has a cache miss because exact-match algorithm
doesnt match Q2 ;
Copyright 2015, Oracle and/or its affiliates. All rights reserved.
Oracle
|
Confidential Internal

48

Program Agenda
1

BI Mashup Performance Optimizations

Best practices

Aggregate persistence

Caching

Case studies
Q&A
Copyright 2015, Oracle and/or its affiliates. All rights reserved.
Oracle
|
Confidential Internal

49

Column size mismatch


Inefficient memory utilization
Ensure that data model is efficient.
Email column taking 2,000 characters is not obvious (10 such columns)
Alternatively, modify RPD by creating opaque table (not the desired
option)

Copyright 2015, Oracle and/or its affiliates. All rights reserved.


Oracle
|
Confidential Internal

50

Use Init Block judiciously


Issue: BI Server memory is too high (40GB)
in few minutes when large number of logins
would occur
Cause:
Each login was invoking a init block which
would fetch 68,000 rows adding up to 38
MB
OBIS memory would not come down after
users have logged out or timed out
Large memory usage by OBIS was
depriving other processes of memory.
Only option to reclaim memory was to
restart OBIS
Fix:
Enable caching for row-wise init block such
that it gets executed only once for the life
of the server. Cache lasts for the life of
the server and cannot be refreshed like
repository init block.
Copyright 2015, Oracle and/or its affiliates. All rights reserved. |

Oracle Confidential Internal

51

Nested REPLACE
Nested replace statement results in padding large amount of data since
for each replace it would allocate maximum size (1500 characters in this
case)
Query returns 200+ MB for 3 rows
Projection column is VARCHAR(1500)
For each replace statement padded size grows exponentially
This would occur with other concatenated functions like concat
cast the nested replace :

REPLACE(REPLACE(REPLACE(REPLACE("Sales - CRM Interactions and Customers Real


Time"."Interaction Extension"."Extension Attribute Character
006",'U','Undecided'),'S','Successful'),'N','Not-Successful'),'I','Incomplete')
CAST(REPLACE(REPLACE(REPLACE(REPLACE("Sales - CRM Interactions and
Customers Real Time"."Interaction Extension"."Extension Attribute Character
006",'U','Undecided'),'S','Successful'),'N','Not-Successful'),'I','Incomplete') AS
VARCHAR(1500))

Parameter OBIS_MAX_FIELD_SIZEwas introduced to govern the field size


(default: 32K)
Copyright 2015, Oracle and/or its affiliates. All rights reserved.
Oracle
|
Confidential Internal

52

Setting hints
Hints that you intend to pass to
the end datasource (ORDBMS) can
be set in RPD at connection or
query level:
Execute on connect /
disconnect
Execute before / after query
Upon disconnect if statement
errors, connection is damaged
and not returned to pool and
counter not decremented
Eventually connections will be
saturated and system will be
frozen since no connections are

Copyright 2015, Oracle and/or its affiliates. All rights reserved. |

Oracle Confidential Internal

53

Table / VO Pruning
Use correct cardinality, 1:N results in
more efficient SQL generation
compared to (0,1):N
Tables used in query with (0,1):N
cardinality
PER_LOCATION_DETAILS_F_TL
PER_LOCATION_DETAILS_F_VL
POR_REQUISITION_LINES_ALL
POR_REQUISITION_HEADERS_ALL
PO_LINE_LOCATIONS_ALL
PO_VERSIONS_INIT_SEQUENCE_V
FUN_ALL_BUSINESS_UNITS_V
GL_LEDGERS
FND_CURRENCIES_B
FND_CURRENCIES_TL
Copyright 2015, Oracle and/or its affiliates. All rights reserved. |

Oracle Confidential Internal

54

Table/ VO Pruning
Unnecessary VOs being used (VO join pruning not occurring)

Copyright 2015, Oracle and/or its affiliates. All rights reserved.


Oracle
|
Confidential Internal

55

Filter rewrite
Old style logical SQL
generation
SELECT
IDOF("BIQA_AW_REL"."C1Channel"."Primary"."All Channels"),
IDOF("BIQA_AW_REL"."C1 Product"."Standard"."Total"),
"BIQA_AW_REL"."C1Channel"."All Channels",
"BIQA_AW_REL"."C1Cube Units Sales Measures"."C1 Sales",
"BIQA_AW_REL"."C1Cube Units Sales Measures"."C1 Units"
FROM "BIQA_AW_REL"

New style physical SQL


generation (after filter
rewrite)

SELECT
IDOF("BIQA_AW_REL"."C1Channel"."Primary"."All
Channels"),
UNION ALL
IDOF("BIQA_AW_REL"."C1 Product"."Standard"."Total"),
SELECT
"BIQA_AW_REL"."C1Channel"."All Channels",
CAST(NULL AS INTEGER),
IDOF("BIQA_AW_REL"."C1 Product"."Standard"."Total"),
"BIQA_AW_REL"."C1Cube Units Sales Measures"."C1
CAST(NULL AS INTEGER),
Sales",
"BIQA_AW_REL"."C1Cube Units Sales Measures"."C1 Sales",
"BIQA_AW_REL"."C1Cube Units Sales Measures"."C1
"BIQA_AW_REL"."C1Cube Units Sales Measures"."C1 Units"
FROM "BIQA_AW_REL"
Units",
WHERE
FILTER("BIQA_AW_REL"."C1Cube Units Sales
IDOF("BIQA_AW_REL"."C1Channel"."Primary"."Channel") IN (2, 4)
Measures"."C1 Sales" USING
UNION ALL
IDOF("BIQA_AW_REL"."C1Channel"."Primary"."Channel")
SELECT
CAST(NULL AS INTEGER),
IN (2, 4)) as "SalesCG1",
IDOF("BIQA_AW_REL"."C1 Product"."Standard"."Total"),
FILTER("BIQA_AW_REL"."C1Cube Units Sales
CAST(NULL AS INTEGER),
Measures"."C1 Units" USING
"BIQA_AW_REL"."C1Cube Units Sales Measures"."C1 Sales",
"BIQA_AW_REL"."C1Cube Units Sales Measures"."C1 Units"
IDOF("BIQA_AW_REL"."C1Channel"."Primary"."Channel")
FROM "BIQA_AW_REL"
IN (2, 4)) as "UnitsCG1",
WHERE
FILTER("BIQA_AW_REL"."C1Cube Units Sales
IDOF("BIQA_AW_REL"."C1Channel"."Primary"."Channel") IN (3, 4)
ORDER BY 1
Measures"."C1 Sales" USING
IDOF("BIQA_AW_REL"."C1Channel"."Primary"."Channel")
Copyright 2015, Oracle
and/or its affiliates. All rights reserved.
Oracle
|
Confidential Internal
IN (3, 4)) as "SalesCG2",

56

Filter rewrite
WITH
SAWITH0 AS (select sum(T7209.UNITS) as c1,
sum(T7209.SALES) as c2,
T6641.TOTAL_CHANNEL_ID as c3,
T6716.TOTAL_CUSTOMER_ID as c4,
T7121.TOTAL_PRODUCT_ID as c5
from
PRODUCT_DIM T7121,
CHANNEL_DIM T6641,
CUSTOMER_DIM T6716,

SALES_FACT T7209
where ( T6641.CHANNEL_ID = T7209.CHANNEL_ID and T6716.SHIP_TO_ID =
T7209.SHIP_TO_ID and T7121.ITEM_ID = T7209.ITEM_ID )
group by T6641.TOTAL_CHANNEL_ID, T6716.TOTAL_CUSTOMER_ID,
T7121.TOTAL_PRODUCT_ID),
SAWITH1 AS (select sum(T7209.UNITS) as c1,
sum(T7209.SALES) as c2,
T6716.TOTAL_CUSTOMER_ID as c3,
T7121.TOTAL_PRODUCT_ID as c4
from
PRODUCT_DIM T7121,
CHANNEL_DIM T6641,
CUSTOMER_DIM T6716,

SALES_FACT T7209
where ( T6641.CHANNEL_ID = T7209.CHANNEL_ID and T6716.SHIP_TO_ID =
T7209.SHIP_TO_ID and T7121.ITEM_ID = T7209.ITEM_ID and (T6641.CHANNEL_ID in (2,
4)) and (T7209.CHANNEL_ID in (2, 4)) )
group by T6716.TOTAL_CUSTOMER_ID, T7121.TOTAL_PRODUCT_ID),
SAWITH2 AS (select sum(T7209.UNITS) as c1,
sum(T7209.SALES) as c2,
T6716.TOTAL_CUSTOMER_ID as c3,
T7121.TOTAL_PRODUCT_ID as c4
from
PRODUCT_DIM T7121,
CHANNEL_DIM T6641,
CUSTOMER_DIM T6716,

More efficient sql, execution


results in single pass on fact
table
WITH
SAWITH0 AS (select sum(T7209.UNITS) as c1,
sum(T7209.SALES) as c2,
sum(case when T6641.CHANNEL_ID in (2, 4)
as c3,
sum(case when T6641.CHANNEL_ID in (2, 4)
as c4,
sum(case when T6641.CHANNEL_ID in (3, 4)
as c5,
sum(case when T6641.CHANNEL_ID in (3, 4)
as c6,
T6641.TOTAL_CHANNEL_ID as c7,
T6716.TOTAL_CUSTOMER_ID as c8,
T7121.TOTAL_PRODUCT_ID as c9
from
PRODUCT_DIM T7121,
CHANNEL_DIM T6641,
CUSTOMER_DIM T6716,

then T7209.SALES end )


then T7209.UNITS end )
then T7209.SALES end )
then T7209.UNITS end )

SALES_FACT T7209

where ( T6641.CHANNEL_ID = T7209.CHANNEL_ID and


T6716.SHIP_TO_ID = T7209.SHIP_TO_ID and T7121.ITEM_ID =
T7209.ITEM_ID )
SALES_FACT T7209
group by T6641.TOTAL_CHANNEL_ID, T6716.TOTAL_CUSTOMER_ID,
where ( T6641.CHANNEL_ID = T7209.CHANNEL_ID and T6716.SHIP_TO_ID =
T7121.TOTAL_PRODUCT_ID)
T7209.SHIP_TO_ID and T7121.ITEM_ID = T7209.ITEM_ID and (T6641.CHANNEL_ID in (3,
select distinct 0 as c1,
4)) and (T7209.CHANNEL_ID in (3, 4)) )
group by T6716.TOTAL_CUSTOMER_ID, T7121.TOTAL_PRODUCT_ID),
Copyright 2015, Oracle
Oracle
|
Confidential Internal
and/or its affiliates. All rights reserved.
SAWITH3 AS (((select distinct 0 as c1,

57

Filter rewrite
Convert a physical column CASE statement into a logical column definition
based on filter function
Logical Query:SELECT Time.Quarter saw_0, Time.Week saw_1, rsum("Fact - RMW
Opportunity"."Expected Revenue (000)") saw_3 FROM "Sales - Sales Revenue and
Pipeline" WHERE (Time.Quarter = VALUEOF(CURRENT_QUARTER)) ORDER BY saw_0,
saw_1

Old Physical Query:


select T264047."PER_NAME_QTR" as c1, T264047."PER_NAME_WEEK" as c2,
sum(case when T346644."LOST_FLG" = 'N' and T346644."SUMMARY_FLG" = 'Y' then
T346644."REVN" end ) as c5
from "W_DAY_D" T264047, "W_REVN_F" T346644
where ( T264047."ROW_WID" = T346644."CLOSE_DT_WID" and T264047."PER_NAME_QTR" = '2004 Q 2' )
group by T264047."PER_NAME_QTR", T264047."PER_NAME_WEEK order by c1, c2

New Physical Query:


select T264047."PER_NAME_QTR" as c1, T264047."PER_NAME_WEEK" as c2, sum(T346644."REVN") as c5
from "W_DAY_D" T264047, "W_REVN_F" T346644
where ( T346644."LOST_FLG" = 'N' and T264047."PER_NAME_QTR" = '2004 Q 2' and T264047."ROW_WID" =
T346644."CLOSE_DT_WID" and T346644."SUMMARY_FLG" = 'Y' )
Copyright 2015, Oracle and/or its affiliates. All rights reserved.
Oracle
|
Confidential Internal
58
group by T264047."PER_NAME_QTR", T264047."PER_NAME_WEEK
order by c1, c2

Missing descriptor id column


Inefficient SQL Plan due to missing
Descriptor Id Column when using lookup
With OBIS cache ON, queries which
include lookup do not perform because
the plan generated by nqsserver is
suboptimal.
OBIS executes each lookup queryand
then stitches it together.
For the query in question, we saw RT of
18+ sec with 7K+ rows being fetched
for each lookup.
Fix isto specify "Descriptor ID Column"
for the lookup.Query generation
enginein that case creates a better
plan by sending the complete query to
database and RT is reduced to 7 sec.

Copyright 2015, Oracle and/or its affiliates. All rights reserved. |

Oracle Confidential Internal

59

Performance flags
DISABLE_NO_MERGE_HINT_FOR_LOOKUP
BI Server adds a NO_MERGE hint to all lookup query blocks shipped
to Oracle data sources to prevent the optimizer from merging the
lookup query block with the main query.Set
DISABLE_NO_MERGE_HINT_FOR_LOOKUPvariable to 1 to disable
OBIS_VALUE_PROMPT_LOOKUP_DIRECT_ACCESS
In OTBI, some prompt queries perform better if server queries
lookup table instead of the base dimension table. This optimization
is restricted to very specific types of queriesonly prompt queries
issued by OBIPS where theQUERY_SRC_CDrequest variable is set to
eitherValuePromptorDisplayValueMapand the selected columns
can be traced back to a single lookup table.
PERF_PREFER_SUBQUERY_CACHE_SEED
By default, subquery cache seed is disabled. In some cases, for
Copyright 2015, Oracle and/or its affiliates. All rights reserved.
Oracle
|
Confidential Internal

60

Program Agenda
1

BI Mashup Performance Optimizations

Best practices

Aggregate persistence

Caching

Case studies
Q&A
Copyright 2015, Oracle and/or its affiliates. All rights reserved.
Oracle
|
Confidential Internal

61

Copyright 2015, Oracle and/or its affiliates. All rights reserved.


Oracle
|
Confidential Internal

62

Potrebbero piacerti anche