Oracle Business Intelligence Applications

Welcome to the Oracle Analytics Community: Please complete your User Profile and upload your Profile Picture

Replacement of Ago function

Received Response
1
Views
2
Comments

Hi Guys,

We have a reporting tool which extracts reports from tables having data ~30 millions records.

Users have created many analysis which uses a field (field name - "trailing twelve months") formulated at logical layer , this field returns sum of a field values for last 12 months.

Many filters are added further in analysis based on user's requirement.

Currently this field is built at logical layer using Ago function, it works fine but performance is too bad! Users have almost stopped using it.

After analyzing we found that because in "trailing twelve months" calculations Ago function has been used 4 times for last 4 quarters, a very costly query is run at physical layer 4 times, that too without any where clause. It seems to be the main issue of bad performance.

I tried below options:

1. Using Log function instead of Ago at logical layer - failed! because Lag function can be used to formulate series of values

2. Created DB function to calculate SUM of required field for last 12 months and mapped to logical layer - failed! because user wants to add many other filters dynamically, so returning aggregated values from DB doesn't work.

Please help on this.

Thanks!

Answers

  • Hi,

    If you expect to find a "pleaso_go_fast_AGO" no luck it doesn't exist ...

    3016375 wrote:
    
    It seems to be the main issue of bad performance.
    

    Actually it would be better if you clearly find out if it is or not the main issue, because having the feeling it is to find out after 2-3 days of tests of possible alternatives it isn't the issue ... you will not like it ;-)

    Actually you can also model the AGO functionality, mainly if it's always fixed on 12 months ago, by modelling it with an alias of your fact table joined to your calendar dimension applying the "12 months ago" logic. In that way you change completely the physical query in case it helps.

    But I would highly suggest to first be sure of what is taking time in your queries and in case to ask a DBA to have a look (reminding him that OBIEE generate queries and it's not something you do by hand ...).

  • Thomas Dodds
    Thomas Dodds Rank 8 - Analytics Strategist

    Great points by Gianni!

    Or you could store the ago value in the same row in the fact in it's own column ... two values out of a single row fetch.  You have quite a few options for performance here.