I am a newbie to data warehouses and I have an excruciatingly painful variance report from a normalized db that takes 4min 15 sec to run (about 1000 rows). Eventually, I'm going to need a separate report for each dept in a 25+ dept company, which means almost 2 hours of processing.
This report compares 2 tables (budget & actual) for several different accounts for month-to-date, quarter-to-date, and year-to-date. So the report looks like this:
Both the budget and actual data sources are intermediary 'denormalized' tables that list each employee and GL amount for each payperiod (bimonthly). So the sample above is actually pulling from ALL records of all GL codes for each employee (72000 records for each data source table). A sample of the 'actual cost' source data is:
I know that a data mart / warehouse basically denormalizes and aggregates data to speed up these kinds of reports. Are my intermediary tables accomplishing this, or is there an even better way to speed up this excruciatingly slow report?
Is there a good source somewhere for strategies on this?
The most timeconsuming query in the report process is a query that joins the YTD Var query to the QTD and MTD Var queries. Individually, these subqueries take 10 seconds, but when the YTD is querying the other 2 with all relationships, the result takes 4 mins.