dbTalk Databases Forums  

The processing SQL: join the dimension tables or not?

microsoft.public.sqlserver.olap microsoft.public.sqlserver.olap


Discuss The processing SQL: join the dimension tables or not? in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
nick
 
Posts: n/a

Default The processing SQL: join the dimension tables or not? - 07-08-2005 , 03:56 PM






I found that
1) some cubes' processing SQL (the SQL used to pull data when processing)
include/join all the dimension tables.
2) But some cubes don't join all the dimension tables.

So if the joint keys of fact table have some values that not exists in the
join key of the dimension tables. These two situations behave differently:

For (1), there will have less rows in the cube because the joining
elimilated these rows not exists in the joined dimension tables.

For (2), the process will report error that "some value exists in fact table
but not in level "..." of dimension...

How to force the cube processing as the second case?
Thanks.

Reply With Quote
  #2  
Old   
Kris
 
Posts: n/a

Default RE: The processing SQL: join the dimension tables or not? - 07-08-2005 , 07:36 PM






You need to update Dimension table before processing cube. Follow below logic
to make sure you are including all Fact keys into dimension table. once you
add new members into Dimtable you have to process dimension first.

insert into DimTable
select x,y,z from Facttable
where x not in(select x rom DimTable)

Kris

"nick" wrote:

Quote:
I found that
1) some cubes' processing SQL (the SQL used to pull data when processing)
include/join all the dimension tables.
2) But some cubes don't join all the dimension tables.

So if the joint keys of fact table have some values that not exists in the
join key of the dimension tables. These two situations behave differently:

For (1), there will have less rows in the cube because the joining
elimilated these rows not exists in the joined dimension tables.

For (2), the process will report error that "some value exists in fact table
but not in level "..." of dimension...

How to force the cube processing as the second case?
Thanks.

Reply With Quote
  #3  
Old   
nick
 
Posts: n/a

Default RE: The processing SQL: join the dimension tables or not? - 07-08-2005 , 10:31 PM



Thanks. Yes, I know i need process dimension first to make everything
correct. However, in the case 1 I mentioned, the processing SQL join the
dimension table and eliminated the rows with unmatched fact keys and thus
hide the error.

That's why I want the case 2 always so the error will raise explicitly. And
I don't understand why Analysis Service handle(generate) the SQL differently.

"Kris" wrote:

Quote:
You need to update Dimension table before processing cube. Follow below logic
to make sure you are including all Fact keys into dimension table. once you
add new members into Dimtable you have to process dimension first.

insert into DimTable
select x,y,z from Facttable
where x not in(select x rom DimTable)

Kris

"nick" wrote:

I found that
1) some cubes' processing SQL (the SQL used to pull data when processing)
include/join all the dimension tables.
2) But some cubes don't join all the dimension tables.

So if the joint keys of fact table have some values that not exists in the
join key of the dimension tables. These two situations behave differently:

For (1), there will have less rows in the cube because the joining
elimilated these rows not exists in the joined dimension tables.

For (2), the process will report error that "some value exists in fact table
but not in level "..." of dimension...

How to force the cube processing as the second case?
Thanks.

Reply With Quote
  #4  
Old   
Dave Wickert [MSFT]
 
Posts: n/a

Default Re: The processing SQL: join the dimension tables or not? - 07-09-2005 , 06:30 PM



What you are seeing is what the "optimize schema" wizard in the cube editor
is doing. See BOL for rmore details. The preferred (although not the
default) operations would be to the optimize schema wizard remove the joins
for all dimensions ( if you meet the requirements in BOL). The only join
which cannot be eliminated (without poking the regsitry) is for the data
slice if you are using partitioning.

This is talked about in the AS Operations Guide also
http://www.microsoft.com/technet/pro.../anservog.mspx

--
Dave Wickert [MSFT]
dwickert (AT) online (DOT) microsoft.com
Program Manager
BI SystemsTeam
SQL BI Product Unit (Analysis Services)
--
This posting is provided "AS IS" with no warranties, and confers no rights.


"nick" <nick (AT) discussions (DOT) microsoft.com> wrote

Quote:
Thanks. Yes, I know i need process dimension first to make everything
correct. However, in the case 1 I mentioned, the processing SQL join the
dimension table and eliminated the rows with unmatched fact keys and thus
hide the error.

That's why I want the case 2 always so the error will raise explicitly.
And
I don't understand why Analysis Service handle(generate) the SQL
differently.

"Kris" wrote:

You need to update Dimension table before processing cube. Follow below
logic
to make sure you are including all Fact keys into dimension table. once
you
add new members into Dimtable you have to process dimension first.

insert into DimTable
select x,y,z from Facttable
where x not in(select x rom DimTable)

Kris

"nick" wrote:

I found that
1) some cubes' processing SQL (the SQL used to pull data when
processing)
include/join all the dimension tables.
2) But some cubes don't join all the dimension tables.

So if the joint keys of fact table have some values that not exists in
the
join key of the dimension tables. These two situations behave
differently:

For (1), there will have less rows in the cube because the joining
elimilated these rows not exists in the joined dimension tables.

For (2), the process will report error that "some value exists in fact
table
but not in level "..." of dimension...

How to force the cube processing as the second case?
Thanks.



Reply With Quote
  #5  
Old   
nick
 
Posts: n/a

Default Re: The processing SQL: join the dimension tables or not? - 07-10-2005 , 01:03 AM



Thanks, it works great.

"Dave Wickert [MSFT]" wrote:

Quote:
What you are seeing is what the "optimize schema" wizard in the cube editor
is doing. See BOL for rmore details. The preferred (although not the
default) operations would be to the optimize schema wizard remove the joins
for all dimensions ( if you meet the requirements in BOL). The only join
which cannot be eliminated (without poking the regsitry) is for the data
slice if you are using partitioning.

This is talked about in the AS Operations Guide also
http://www.microsoft.com/technet/pro.../anservog.mspx

--
Dave Wickert [MSFT]
dwickert (AT) online (DOT) microsoft.com
Program Manager
BI SystemsTeam
SQL BI Product Unit (Analysis Services)
--
This posting is provided "AS IS" with no warranties, and confers no rights.


"nick" <nick (AT) discussions (DOT) microsoft.com> wrote in message
news:511011E3-20E3-4CA3-9C39-F23BA8849AFE (AT) microsoft (DOT) com...
Thanks. Yes, I know i need process dimension first to make everything
correct. However, in the case 1 I mentioned, the processing SQL join the
dimension table and eliminated the rows with unmatched fact keys and thus
hide the error.

That's why I want the case 2 always so the error will raise explicitly.
And
I don't understand why Analysis Service handle(generate) the SQL
differently.

"Kris" wrote:

You need to update Dimension table before processing cube. Follow below
logic
to make sure you are including all Fact keys into dimension table. once
you
add new members into Dimtable you have to process dimension first.

insert into DimTable
select x,y,z from Facttable
where x not in(select x rom DimTable)

Kris

"nick" wrote:

I found that
1) some cubes' processing SQL (the SQL used to pull data when
processing)
include/join all the dimension tables.
2) But some cubes don't join all the dimension tables.

So if the joint keys of fact table have some values that not exists in
the
join key of the dimension tables. These two situations behave
differently:

For (1), there will have less rows in the cube because the joining
elimilated these rows not exists in the joined dimension tables.

For (2), the process will report error that "some value exists in fact
table
but not in level "..." of dimension...

How to force the cube processing as the second case?
Thanks.




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.