BO Best Practices Data Connectivity
BO Best Practices Data Connectivity
Contents
INTRODUCTION ............................................................................................ 2
TUNING THE DATABASE ............................................................................... 2
Data models best practices ...........................................................................2
Creating a new schema .................................................................................. 2
Modifying an existing schema ...................................................................... 4
Database server settings ..............................................................................4
Oracle................................................................................................................ 5
Teradata............................................................................................................ 5
SQL Server ....................................................................................................... 5
IBM DB2 ........................................................................................................... 5
Sybase ............................................................................................................... 6
TUNING THE CONNECTIVITY ......................................................................... 6
Increase the Array Fetch Size ......................................................................6
ConnectInit for optimization parameters .....................................................6
TUNING THE UNIVERSE ................................................................................ 7
Aggregate awareness ...................................................................................7
Index awareness ...........................................................................................7
Merged joins (Join_By_SQL parameter) .....................................................8
Derived tables ..............................................................................................8
Shortcut joins...............................................................................................9
Table filtering based on size (Boundary_Weight_Table) .............................9
Table filters in the FROM clause .................................................................9
Multi-sourcing with Data Federator for optimized filtering ..................... 10
Database analytic functions ....................................................................... 11
TUNING THE REPORT ................................................................................. 11
Display all data in the same page or in a page by page mode .................... 11
Filter at query or at report level ................................................................. 11
Choose the right scope of analysis .............................................................. 12
Schedule reports ......................................................................................... 12
CONCLUSION ............................................................................................ 12
11/6/2007 11:36:00 AM Copyright © 2007 Business Objects. All rights reserved. Page 1
Business Objects Semantic Layer Best Practices Accessing Databases
Introduction
When it comes to optimization of a BI deployment and of the
performance of queries on very large databases (VLDBs), we find that
each situation has specific issues and specific solutions. The Business
Objects semantic layer doesn’t force the customer to adopt a dedicated
database architecture or schema and it allows for personalized
optimization settings while adapting to any data model and source type.
Optimizations can be added at different levels: database, connectivity,
universe, and report. Improvements and additional tunings can be done
during the whole lifecycle of the BI solution with a minimal or even null
impact on the final user workflows (but for an improved performance).
In this document, we will discuss possible improvements which can be
done in a short period. The list is not exhaustive and technical details are
left out.
As this is quite a complex task with our ad-hoc query tools, we give the
opportunity to tag a query as coming from one of our applications. This
allows the database administrator to analyze our queries and decide
what database optimizations can be made.
One of the benefits of the Business Objects semantic layer is that it can
access any data schema and doesn’t require the creation of new tables,
views, or indexes in the database. This said, if a user has the opportunity
to modify the database model or create a new one to be used by Business
Objects applications, than this model can be made to suit the best
practices for optimal query performance and can be subsequently fine-
tuned.
11/6/2007 11:36:00 AM Copyright © 2007 Business Objects. All rights reserved. Page 2
bo_accessing_databases_best_practices.pdf
Business Objects Semantic Layer Best Practices Accessing Databases
optimizations which can be done at the schema level for use with
Business Objects applications.
Limit the number of joins while keeping the record size low
If the queries are known in advance and there is complete freedom in the
configuration of the data model, the schema should be fine-tuned to
decrease the number of joins and the quantity of data which is necessary
for the generation of a correct answer but which is not needed in the
final answer.
Joins can be reduced by putting in the same table the items which are
supposed to be requested often together or by creating join indexes or
tables to bypass the normal whole join path from one data to another.
Aggregate tables
Aggregation of data within tables avoids complex calculations at the
Business Objects semantic layer level. The semantic layer offers a
functionality called Aggregate Awareness which automatically makes
the SQL sentence optimally point to the highest aggregation level
available in the schema for the requested result set.
Partitioned tables
Table partitioning is a database feature allowing a table to be split in
many parts, each one with a specific partitioning dimension (e.g. split a
Sales tables per Year of Sale). When receiving the query, the database
will send the request to the correct table without the need to parse all
data.
bo_accessing_databases_best_practices.pdf
Business Objects Semantic Layer Best Practices Accessing Databases
Many database vendors provide tools for optimizing the indexes which
audit the SQL to be processed and suggest possible indexes to be created.
Business Objects tools provide ways to retrieve the final SQL generated
and passed to the database. By running the SQL in the optimization
tools, it is possible to see what the best indexes to create are.
Aggregate tables
As discussed above, aggregate tables can provide better performance by
pre-calculating values at the database level. Aggregate tables can be
added to an existing schema with no impact for existing applications.
The addition of aggregation tables requires additional space into the
database, but this space is not always large and it can be pre-calculated
(and limited with some DB-specific tools) in advance.
Database Views
If space is an issue, database views can be created to aggregate or pre-
select information stored in tables. New database views have no impact
on existing applications already accessing the database. Views are less
performing than aggregate tables as the data is to be computed each time
they are accessed, but do not require updates or take up significant space
in the database. Calculations done at database view level might be faster
than the same calculations done at the Business Objects client tool or
universe level. Business Objects semantic layer treats views as if they
were tables in the database.
11/6/2007 11:36:00 AM Copyright © 2007 Business Objects. All rights reserved. Page 4
bo_accessing_databases_best_practices.pdf
Business Objects Semantic Layer Best Practices Accessing Databases
Oracle
The following features can be considered:
• Star-schema optimizer
• Materialized views
• Table compression
Additional information can be found in the following document
http://www.oracle.com/technology/deploy/performance/pdf/twp_pe
rf_database%20performance%20with%20oracle10gr2.pdf
Teradata
The following features can be considered:
http://www.microsoft.com/technet/prodtechnol/sql/2000/maintain/rdbmspf
t.mspx
http://www.microsoft.com/technet/prodtechnol/sql/bestpractice/dw_perf_t
op10.mspx
IBM DB2
The following features can be considered:
11/6/2007 11:36:00 AM Copyright © 2007 Business Objects. All rights reserved. Page 5
bo_accessing_databases_best_practices.pdf
Business Objects Semantic Layer Best Practices Accessing Databases
http://www-128.ibm.com/developerworks/db2/library/techarticle/dm-
0404mcarthur/
Sybase
The following features can be considered:
NOTE If you need to retrieve 100 rows and have an Array Fetch Size of 20, then 5 fetch
operations will be executed. If you have the value to 100 or higher, then only 1 fetch
operation will be executed (but the network package will be bigger).
It is useful to test with different values to find the correct balance of fetch
operations vs. size of network transfers.
NOTE With Sybase ASE it would be possible e.g. to set the database query optimization
algorithm to perform DSS queries and not the default OLTP ones for the session.
With Teradata it would be possible e.g. to set the row read lock level to access for the
session to generate an optimized tactical query
11/6/2007 11:36:00 AM Copyright © 2007 Business Objects. All rights reserved. Page 6
bo_accessing_databases_best_practices.pdf
Business Objects Semantic Layer Best Practices Accessing Databases
Aggregate awareness
If Aggregate tables are available in the database, Business Objects
semantic layer offers a specific function to transparently make use of
them.
EXAMPLE In a data model there is a fact table for sales on a transaction level detail and an
aggregated table with sales per day. If the final user chooses to see sales details then the
transaction table will be used, if the user wants to see sales per day then the aggregate
table will be used. This is fully transparent to the final user.
Index awareness
It is possible to have the query generator to make use of keys instead of
labels whenever possible. This feature optimizes the SQL as it decreases
the number of joins needed in a sentence and parses (usually ordered)
numbers instead than text. Just by defining the primary and foreign keys
for an object, the SQL will take care of generating the most performing
SQL.
11/6/2007 11:36:00 AM Copyright © 2007 Business Objects. All rights reserved. Page 7
bo_accessing_databases_best_practices.pdf
Business Objects Semantic Layer Best Practices Accessing Databases
To enable this feature, the universe parameters must contain the value
Join_By_SQL=Yes.
Derived tables
Some calculations or filtering which are done at universe or report level
could be pushed down to database level (without the need to actually
modify the database). This has two advantages: final users have less
work to do (they do not need to create the calculation); there is an
improvement of performance as the database calculation engine might
be faster on the database data and there is less data transferred.
11/6/2007 11:36:00 AM Copyright © 2007 Business Objects. All rights reserved. Page 8
bo_accessing_databases_best_practices.pdf
Business Objects Semantic Layer Best Practices Accessing Databases
NOTE In Teradata, Derived Tables have a better performance than Virtual Tables. We do not
support Virtual tables since their functionality can be obtained by using the more
performing and dynamic Derived Tables.
Shortcut joins
Shortcut Joins are alternative join paths which designers can define in
the data foundation wherever possible. The query generation engine,
when defining the query sentence, will look for all possible paths and
will choose the shortest one in term of joins. Shortcuts are not taken into
account to define contexts but only to decrease the number of joins
whenever possible.
In this data foundation, you can go from Amount_Sold to Promotion_cost directly without the need to join the Article_lookup table.
The SQL generator will decide the fastest path based on the objects requested in the query.
In the statement above, only the columns necessary for the query are
retrieved and the condition in the inner statement limits the number of
records to parse in the outer one.
11/6/2007 11:36:00 AM Copyright © 2007 Business Objects. All rights reserved. Page 9
bo_accessing_databases_best_practices.pdf
Business Objects Semantic Layer Best Practices Accessing Databases
A statement like
…
FROM
Country INNER JOIN Region ON
(Country.country_id=Region.country_id)
…
WHERE
Country.country In ( 'France','US' )
Becomes
…
FROM
Country INNER JOIN Region ON
(Country.country_id=Region.country_id AND Country.country
In ( 'France','US' ))
…
In the first statement the join is done on all IDs and then the data is
filtered, in the second statement, the data is filtered and then the join is
done on all remaining IDs.
It is also possible to push the data federation down at the universe level
using Business Objects Data Federator. This provides a couple of
benefits: the user does not have to deal with the two different data
sources and the query performance is improved thanks to the Data
Federator intelligent generation. The benefit of using the Data Federation
multisource engine is dramatic when filtering a very large database table
with a short list of values from elsewhere.
EXAMPLE A user needs to retrieve all sales for a list of 15 customers. The sales information comes
from the data warehouse, the list of customers comes from a small Access database.
One way to generate the query is to retrieve all customers from Access, all Sales from the
warehouse and then filter within our own tools.
Business Objects Data Federator reads the list of customers from Access first, then
queries the warehouse for all sales where the customer is in the list. The data retrieved
from the warehouse is smaller than in the first case where all sales were returned.
11/6/2007 11:36:00 AM Copyright © 2007 Business Objects. All rights reserved. Page 10
bo_accessing_databases_best_practices.pdf
Business Objects Semantic Layer Best Practices Accessing Databases
NOTE Analytic functions usually include Ranking, Accumulative aggregation, Ratio, Ratio to
Report, and Reporting Aggregate. Thanks to the open semantic layer architecture of
Business Objects, it is possible to use any function available in the database.
Some examples of such functions are:
RANK (over partition), SUM (over partition), Ratio_to_Report (over partition) for DB2 or
Oracle;
RANK, CSUM, MAVG, MDIFF, MLINREG, MSUM for Teradata
By filtering in the query, you will retrieve less data from the database,
hence the query will be faster. This technique is best suited if you are
confident that you will get all the data needed for your analysis without
the need to go back to the database.
By filtering in the report, you will retrieve more data than needed from
the database, hence the query will be slower. This technique is best
suited if you are not sure of the level of details needed from the database
to complete your analysis. More time will be needed to run the query but
afterwards, by filtering within the report, no additional time will be
required to go back to query the database.
11/6/2007 11:36:00 AM Copyright © 2007 Business Objects. All rights reserved. Page 11
bo_accessing_databases_best_practices.pdf
Business Objects Semantic Layer Best Practices Accessing Databases
Schedule reports
If a report takes a long time to refresh, it might be best to schedule it and
just open it without refresh once it is available. Our tools can notify users
when a report is ready to be read after a refresh. To allow for a deep
analysis within the report without the need to go back to the database,
the report can be set with a large scope of analysis and a reduced
number of filters, and be read in a one-page only mode. Once the report
is done, the exchanges with the database will be null and the exchanges
with the Web Intelligence server will be minimized while keeping full
interactivity and analysis capability.
Conclusion
The Business Objects semantic layer can adapt to any database size and
any database schema. It allows tuning for performance at all levels of the
data chain, from the database server settings to the final report.
Whenever possible, the Business Objects semantic layer pushes the load
to the database to make the best use of the database capabilities and
resources. The ‘isolation’ level provided by the semantic layer allows for
heavy database- or universe-level changes during the lifetime of an
evolving BI solution without any impact for the end users’ work (apart
from an improved performance). A good performance of the business
intelligence solution starts with a well planned project where final users,
BI experts and database administrators work together to define
requirements and optimizations needed at all levels.
11/6/2007 11:36:00 AM Copyright © 2007 Business Objects. All rights reserved. Page 12
bo_accessing_databases_best_practices.pdf
Business Objects Semantic Layer Best Practices Accessing Databases
www.businessobjects.com
No part of the computer software or this document may be reproduced or transmitted in any form or by any means,
electronic or mechanical, including photocopying, recording, or by any information storage and retrieval system,
without permission in writing from Business Objects.
The information in this document is subject to change without notice. Business Objects does not warrant that this
document is error free.
This software and documentation is commercial computer software under Federal Acquisition regulations, and is
provided only under the Restricted Rights of the Federal Acquisition Regulations applicable to commercial computer
software provided at private expense. The use, duplication, or disclosure by the U.S. Government is subject to
restrictions set forth in subdivision (c) (1) (ii) of the Rights in Technical Data and Computer Software clause at
252.227-7013.
The Business Objects product and technology are protected by US patent numbers 5,555,403; 6,247,008;
6,578,027; 6,490,593; and 6,289,352. The Business Objects logo, the Business Objects tagline,
BusinessObjects, BusinessObjects Broadcast Agent, BusinessQuery, Crystal Analysis, Crystal Analysis
Holos, Crystal Applications, Crystal Enterprise, Crystal Info, Crystal Reports, Rapid Mart, and
WebIntelligence are trademarks or registered trademarks of Business Objects SA in the United States
and/or other countries. Various product and service names referenced herein may be trademarks of
Business Objects SA. All other company, product, or brand names mentioned herein, may be the
trademarks of their respective owners. Specifications subject to change without notice. Not responsible for
errors or omissions.
11/6/2007 11:36:00 AM Copyright © 2007 Business Objects. All rights reserved. Page 13
bo_accessing_databases_best_practices.pdf