Changes to Dynamic Repository Variables

Managing Performance Tuning and Query Caching 7-23

7.7.1.1 Ensuring Correct Cache Results When Using Row-Level Database Security

When using a row-level database security strategy, such as a Virtual Private Database VPD, the returned data results are contingent on the authorization credentials of the user. Because of this, the Oracle BI Server must know whether a data source is using row-level database security and which variables are relevant to security. To ensure that cache hits only occur on cache entries that include and match all security-sensitive variables, you must correctly configure the database object and session variable objects in the Administration Tool, as follows: ■ Database object. In the Physical layer, in the General tab of the Database dialog, select Virtual Private Database to specify that the data source is using row-level database security. If you are using row-level database security with shared caching, then you must select this option to prevent the sharing of cache entries whose security-sensitive variables do not match. Session variable values must match, including security session variables If the logical SQL or physical SQL statement refers to any session variable, then the session variable values must match. Otherwise, the cache is not hit. In addition, the value of session variables that are security sensitive must match the security session variable values that are defined in the repository, even though the logical SQL statement itself does not reference session variables. See Section 7.7.1.1, Ensuring Correct Cache Results When Using Row-Level Database Security for more information. Equivalent join conditions The resultant joined logical table of a new query request has to be the same as or a subset of the cached results to qualify for a cache hit. DISTINCT attribute must be the same If a cached query eliminates duplicate records with DISTINCT processing for example, SELECT DISTINCT..., then requests for the cached columns must also include the DISTINCT processing; a request for the same column without the DISTINCT processing is a cache miss. Queries must contain compatible aggregation levels Queries that request an aggregated level of information can use cached results at a lower level of aggregation. For example, the following query requests the quantity sold at the supplier and region and city level: SELECT supplier, region, city, qtysold FROM suppliercity The following query requests the quantity sold at the city level: SELECT city, qtysold FROM suppliercity The second query results in a cache hit on the first query. Limited additional aggregation For example, if a query with the column qtysold is cached, then a request for RANKqtysold results in a cache miss. Additionally, a query that requests qtysold at the country level can get a cache hit from a query that requests qtysold at the country, region level. ORDER BY clause must be comprised of columns in the select list Queries that order by columns that are not contained in the select list result in cache misses. Avoiding cache misses using advanced hit detection You can avoid some cache misses by setting the parameter USE_ADVANCED_HIT_ DETECTION to YES in the NQSConfig.INI file. Advanced hit detection enables an expanded search of the cache for hits. See USE_ADVANCED_HIT_DETECTION for more information. Table 7–3 Cont. Factors That Determine Whether Cache Is Hit Factor or Rule Description 7-24 System Administrators Guide for Oracle Business Intelligence Enterprise Edition ■ Session Variable object. For variables that you are using for authentication, in the Session Variable dialog, select Security Sensitive to identify them as sensitive to security when using a row-level database security strategy. This option ensures that cache entries are marked with the security-sensitive variables, enabling security-sensitive variable matching on all incoming queries. Refer to the following resources for more information: ■ Setting Up Row-Level Security in the Database in Oracle Fusion Middleware Metadata Repository Builders Guide for Oracle Business Intelligence Enterprise Edition ■ Managing Session Variables in Oracle Fusion Middleware Security Guide for Oracle Business Intelligence Enterprise Edition ■ Oracle Fusion Middleware Metadata Repository Builders Guide for Oracle Business Intelligence Enterprise Edition for general information about database and session variable objects

7.7.2 Running a Suite of Queries to Populate the Cache

To maximize potential cache hits, one strategy is to run a suite of queries to populate the cache. The following are some recommendations for the types of queries to use when creating a suite of queries with which to seed the cache. ■ Common prebuilt queries. Queries that are commonly run, particularly ones that are expensive to process, are excellent cache seeding queries. Queries whose results are embedded in dashboards are good examples of common queries. ■ SELECT lists with no expressions. Eliminating expressions on SELECT list columns expands the possibility for cache hits. A cached column with an expression can only answer a new query with the same expression; a cached column with no expressions can answer a request for that column with any expression. For example, a cached request such as: SELECT QUANTITY, REVENUE... can answer a new query such as: SELECT QUANTITYREVENUE... but not the reverse. ■ No WHERE clause. If there is no WHERE clause in a cached result, then it can be used to answer queries that satisfy the cache hit rules for the select list with any WHERE clause that includes columns in the projection list. In general, the best queries to seed cache with are queries that heavily consume database processing resources and that are likely to be reissued. Be careful not to seed the cache with simple queries that return many rows. These queries for example, SELECT FROM PRODUCTS, where PRODUCTS maps directly to a single database table require very little database processing. Their expense is network and disk overhead, which are factors that caching does not alleviate. When the Oracle BI Server refreshes repository variables, it examines business models to determine if they reference those repository variables. If they do, the Oracle BI Server then purges all cache for those business models. See Section 7.6.3.4, Changes to Dynamic Repository Variables for more information.