Rolling Up and Ranking Faster: Aggregate Transformation or SQL Procedure?

  • Hey Gang,

    I have to do a host of roll ups on sales fact data.

    In SSIS which have you found to faster/better: the

    Aggregate Transformation or a SQL stored procedure?

    There are also a lot of Sales Ranks we need to calculate.

    So far it seems SQL might be the only way [SELECT ROW_NUMBER() OVER (PARTITION BY Date_ID ORDER BY Sales_Qty desc) AS Rank ...]

    If there's better way with a SSIS transformation, that would be

    a great help too.

    [sorry if this is a repeat, did search forum but didn't find.]

    Skål - jh

  • Hi,

    I would personally suggest you not depend on SSIS to accomplish this work. What you can do is add all stuff in Stored Procedure (keep Best Practice cases in mind) and call it in SSIS Execute SQL Task . Not only will this perform much better, it will also likely be less painful to develop.

    However, you can do all this in SSIS also but Transformation may take too long if you have high volume of data.

  • Hi,

    I usually use this as my rule of thumb... If the data needs to be grouped/aggregated only one time i'll do all the work in a stored procedure. But if I need to pull data and group/aggregate it multiple times and/or different ways, I'll do 1 pull to get all the data and do all the aggregations I need and created all the outputs I need. With doing it all in SSIS I don't have to keep going back to the server for pulls.

    SSIS rules when it comes to working with the data once it's in it buffer. SQL server rules when it comes to querying pulling data. So you have to use that to your advantage when deciding which route to go.

    Hope that helps!

    Strick

  • Great Thanks all!

    All good points.

    Yes the data volumn is pretty big and it's been getting slow with just SSIS, I appreciate the sanity check on the Aggregate Transformation.

    Skål - jh

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply