Showing posts with label regarding. Show all posts
Showing posts with label regarding. Show all posts

Thursday, March 8, 2012

Cube Processing with IS packages

Hi,

Just have a quick question regarding the cube processing.

Currently, I've created IS package for the cube processing for better controls.

Before processing the cube, if I have to update the dimension first (since dimension updates everyday and it gives an error if I process the cube itself without dimension updates) then I have to create data flow 'dimension processiong' inside the AS processiong control task?

If so, I need to link the dimension table and connect columns into the dimension in cubes and what else I need to think about before creating this?

I appreciate if anyone can give a suggestion.

Thanks.

Hello! In the starschema in the realtional source you should have foreign keys relations from the dimension tables to the fact table.

In the data source view, in the BIDS cube project, you will need to relate these tables once again, if this is not done automatically.

Your deployed cube is only dependent on the data source when you process the cube, if it is a MOLAP cube.

After you have updated your relational tables(dimensions and fact table) you will only need to process the cube dimensions first and the cube(or measure group) after that.

HTH

Thomas Ivarsson

|||

HI,

Thanks for your reply.

I've already made the relationship between Facts and dimensions in DSV and also checked Dimension usage in each cubes which are molap.

When I process the cube in SSAS, In object list, I need to check dimension update and cube process and it does not give an error but if not, it gives an error ( like attribute can not be found since the dimensions are not updated). My question is that in SSIS I have to check dimension when I run a package but is there anyway to process automatically instead of checking dimension whenever I process the cube?

I appreciate if you can give me any comments.

Thanks.

|||

Hello! I assume that you have also included the processing of dimensions in your SSIS package and before the cube?

In the process cube form in BIDS you have a buttom att the bottom(advanced?) and there you have a setting like process affected objects that you can activate.

HTH

Thomas Ivarsson

Wednesday, March 7, 2012

Cube Processing with IS packages

Hi,

Just have a quick question regarding the cube processing.

Currently, I've created IS package for the cube processing for better controls.

Before processing the cube, if I have to update the dimension first (since dimension updates everyday and it gives an error if I process the cube itself without dimension updates) then I have to create data flow 'dimension processiong' inside the AS processiong control task?

If so, I need to link the dimension table and connect columns into the dimension in cubes and what else I need to think about before creating this?

I appreciate if anyone can give a suggestion.

Thanks.

Hello! In the starschema in the realtional source you should have foreign keys relations from the dimension tables to the fact table.

In the data source view, in the BIDS cube project, you will need to relate these tables once again, if this is not done automatically.

Your deployed cube is only dependent on the data source when you process the cube, if it is a MOLAP cube.

After you have updated your relational tables(dimensions and fact table) you will only need to process the cube dimensions first and the cube(or measure group) after that.

HTH

Thomas Ivarsson

|||

HI,

Thanks for your reply.

I've already made the relationship between Facts and dimensions in DSV and also checked Dimension usage in each cubes which are molap.

When I process the cube in SSAS, In object list, I need to check dimension update and cube process and it does not give an error but if not, it gives an error ( like attribute can not be found since the dimensions are not updated). My question is that in SSIS I have to check dimension when I run a package but is there anyway to process automatically instead of checking dimension whenever I process the cube?

I appreciate if you can give me any comments.

Thanks.

|||

Hello! I assume that you have also included the processing of dimensions in your SSIS package and before the cube?

In the process cube form in BIDS you have a buttom att the bottom(advanced?) and there you have a setting like process affected objects that you can activate.

HTH

Thomas Ivarsson

Cube Processing with IS packages

Hi,

Just have a quick question regarding the cube processing.

Currently, I've created IS package for the cube processing for better controls.

Before processing the cube, if I have to update the dimension first (since dimension updates everyday and it gives an error if I process the cube itself without dimension updates) then I have to create data flow 'dimension processiong' inside the AS processiong control task?

If so, I need to link the dimension table and connect columns into the dimension in cubes and what else I need to think about before creating this?

I appreciate if anyone can give a suggestion.

Thanks.

Hello! In the starschema in the realtional source you should have foreign keys relations from the dimension tables to the fact table.

In the data source view, in the BIDS cube project, you will need to relate these tables once again, if this is not done automatically.

Your deployed cube is only dependent on the data source when you process the cube, if it is a MOLAP cube.

After you have updated your relational tables(dimensions and fact table) you will only need to process the cube dimensions first and the cube(or measure group) after that.

HTH

Thomas Ivarsson

|||

HI,

Thanks for your reply.

I've already made the relationship between Facts and dimensions in DSV and also checked Dimension usage in each cubes which are molap.

When I process the cube in SSAS, In object list, I need to check dimension update and cube process and it does not give an error but if not, it gives an error ( like attribute can not be found since the dimensions are not updated). My question is that in SSIS I have to check dimension when I run a package but is there anyway to process automatically instead of checking dimension whenever I process the cube?

I appreciate if you can give me any comments.

Thanks.

|||

Hello! I assume that you have also included the processing of dimensions in your SSIS package and before the cube?

In the process cube form in BIDS you have a buttom att the bottom(advanced?) and there you have a setting like process affected objects that you can activate.

HTH

Thomas Ivarsson

Sunday, February 19, 2012

CTE and UNION Queries

I have a question regarding the use of CTEs.

The query I'm working on involves a UNION of four or five smaller queries, each doing different things. Each query, however, uses the same base set of records. eg:

SELECT ...
FROM Products p
JOIN ... -- many other tables
WHERE p.ProductIsActive = 1

UNION

SELECT ...
FROM Products p
JOIN ... -- a different set of tables
WHERE p.ProductIsActive = 1

UNION ... -- etc etc

So each subquery is working from the same base set of Products rows.

My idea was to pull that out into a CTE. Something like this:

WITH ActiveProducts AS (
SELECT ProductID
FROM Products
WHERE ProductIsActive = 1
)
SELECT ...
FROM ActiveProducts p
JOIN ... -- many other tables

UNION

SELECT ...
FROM ActiveProducts p
JOIN ... -- a different set of tables

UNION ... -- etc etc

So my question is: If I do it this way, will the "ActiveProducts" CTE get executed for every subquery? Or will it just get executed once and used like a view by each subquery?

Or is there a better way to do this that I'm overlooking?

Thanks!

The CTE should behave just like a view. The best way to see how it will optimize is to look at the plan of the query.

So it should be like:

create view ActiveProducts AS
SELECT ProductID
FROM Products
WHERE ProductIsActive = 1
go

SELECT ...
FROM ActiveProducts p
JOIN ... -- many other tables

UNION

SELECT ...
FROM ActiveProducts p
JOIN ... -- a different set of tables

UNION ... -- etc etc

Or:

SELECT ...
FROM (SELECT ProductID
FROM Products
WHERE ProductIsActive = 1) p
JOIN ... -- many other tables

UNION

SELECT ...
FROM (SELECT ProductID
FROM Products
WHERE ProductIsActive = 1) p
JOIN ... -- a different set of tables

|||you might consider creating a temporary table for your CTE to eliminate multiple execution of the same query.

declare @.ActiveProducts table (ProductId int)

INSERT INTO @.ActiveProducts
SELECT ProductId
FROM Products
WHERE ProductIsActive = 1

SELECT ...
FROM @.ActiveProducts p
JOIN ... -- many other tables

UNION

SELECT ...
FROM @.ActiveProducts p
JOIN ... -- a different set of tables


HTH,