Kimball Forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Too many aggregate tables ?!

5 posters

Go down

Too many aggregate tables ?! Empty Too many aggregate tables ?!

Post  ObjectiveC Tue Mar 29, 2011 12:39 pm

Hello everyone,

I was wondering if there was such a thing as too many aggregate tables (of different levels ofc) on a fact table ?

What are your thoughts on this ?


Cheers !

ObjectiveC

Posts : 25
Join date : 2011-03-18

Back to top Go down

Too many aggregate tables ?! Empty Re: Too many aggregate tables ?!

Post  ngalemmo Tue Mar 29, 2011 5:03 pm

Yeah, sure. Sometimes even 1 aggregate is too many... if it is too specialized or too general (i.e. doesn't improve query performance by much).
ngalemmo
ngalemmo

Posts : 3000
Join date : 2009-05-15
Location : Los Angeles

http://aginity.com

Back to top Go down

Too many aggregate tables ?! Empty Re: Too many aggregate tables ?!

Post  hang Tue Mar 29, 2011 6:05 pm

That's where an OLAP cube comes in handy. Without cube, you really don't have too many options but throwing in aggregates.

It comes down two points, performance and extra maintenance work on numerous aggregates. As long as performance is reasonable, I would stop building aggregates from certain level and let queries/views to dynamically handle the aggregations to limit the extra pressure on ETL maintaining the aggregates. Proliferation on aggregates could potentially blow out the load window of ETL.

hang

Posts : 528
Join date : 2010-05-07
Location : Brisbane, Australia

Back to top Go down

Too many aggregate tables ?! Empty Re: Too many aggregate tables ?!

Post  Dave Jermy Wed Mar 30, 2011 4:37 am

I was wondering if there was such a thing as too many aggregate tables (of different levels ofc) on a fact table ?

If you mean storing aggregates of different levels in a single fact table, this is a big no as the table would have facts of multiple grains and you would always need to be mindful of limiting the aggregation level at query time.

One useful way to design your aggregates is to look at the levels of aggregation at which other metrics suddenly become available and add aggregates of lower level facts to the higher level fact table.

For example, if you have a Shipping fact where the grain is one row for each truck that leaves the depot to make customer deliveries and contains facts like estimated and actual mileage, fuel cost etc., it would be useful to add the number of customers being delivered to, the number and value of order items in the truck, all of which would come from lower level fact tables.

Dave Jermy

Posts : 33
Join date : 2011-03-24
Location : London, UK

Back to top Go down

Too many aggregate tables ?! Empty Re: Too many aggregate tables ?!

Post  ObjectiveC Thu Mar 31, 2011 2:05 am

ngalemmo wrote:Yeah, sure. Sometimes even 1 aggregate is too many... if it is too specialized or too general
I'll keep that in mind when designing, but it goes without saying that I won't keep such a table if it doesn't improve the performance.

hang wrote:That's where an OLAP cube comes in handy....
That's the weird thing. I've created an OLAP cube, but it doesn't improve the performance at all. So I guess I'm doing something wrong there.

Dave Jermy wrote:If you mean storing aggregates of different levels in a single fact table ...
That was not what I meant, but thank you for clarifying :-)


Thank you all for taking the time to reply, I appreciate it !

ObjectiveC

Posts : 25
Join date : 2011-03-18

Back to top Go down

Too many aggregate tables ?! Empty Re: Too many aggregate tables ?!

Post  hang Thu Mar 31, 2011 8:19 am

ObjectiveC wrote:I've created an OLAP cube, but it doesn't improve the performance at all. So I guess I'm doing something wrong there.
It should, if you know cube precalculates all the possible aggregates for all the possible levels in any hierarchies that you configured and store them in cells. So at the query time there's little or non calculation required on the fly, just as what your aggregates are supposed to do, but on much larger scale. That's run time performance.

At the processing time, OLAP cube can carry out numerous calculations/aggregations in a much more efficient way than SQL aggregation and hence performs much better. The number of aggregates that a cube can easily handle would become unmanagelbe by conventional aggregation.

hang

Posts : 528
Join date : 2010-05-07
Location : Brisbane, Australia

Back to top Go down

Too many aggregate tables ?! Empty Re: Too many aggregate tables ?!

Post  Jeff Smith Thu Mar 31, 2011 9:23 am

Sometimes creating aggregates at a slightly higher level than you initially planned is a good thing. Say you had 5 dimensions each with 4 levels in a hierarchy. Your created 5 aggregates. Each aggregate had 4 dimensions at the 3rd level and a 5th dimension at the 4th level. You might be able to create 1 aggregate with all 5 dimensions at the 3rd level. With the right indexes, your 1 aggregate might perform better than the 5 aggregates - it will certainly reduce the load time. This is a good strategy particularly if you are using the aggregates for building cubes.

Jeff Smith

Posts : 471
Join date : 2009-02-03

Back to top Go down

Too many aggregate tables ?! Empty Re: Too many aggregate tables ?!

Post  ObjectiveC Mon Apr 04, 2011 5:03 am

hang wrote:
It should, if you know cube precalculates all the possible aggregates for all the possible levels in any hierarchies that you configured and store them in cells. So at the query time there's little or non calculation required on the fly, just as what your aggregates are supposed to do, but on much larger scale. That's run time performance.

At the processing time, OLAP cube can carry out numerous calculations/aggregations in a much more efficient way than SQL aggregation and hence performs much better. The number of aggregates that a cube can easily handle would become unmanagelbe by conventional aggregation.

I now did create aggregate tables defined in the cube, but I thought it should've been fast without me defining those tables. I thought the cube would give you a performance boost even without the aggregate tables, but I guess that's not the case (at least not with me). In fact when I compare the sql execution time between my sql querytool and with the cube, the cube seems to be somewhat slower.

With the aggregate tables defined, everything is superfast.

Thanks for the help you guys !

ObjectiveC

Posts : 25
Join date : 2011-03-18

Back to top Go down

Too many aggregate tables ?! Empty Re: Too many aggregate tables ?!

Post  Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum