dbTalk Databases Forums  

Using VIEW as Dimensin Table ?

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


Discuss Using VIEW as Dimensin Table ? in the microsoft.public.sqlserver.olap forum.



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

Default Using VIEW as Dimensin Table ? - 06-14-2004 , 10:42 PM






Hi All,
I have a dimension table, below :
CREATE TABLE dbo."Product"(
"ProductID" INT NOT NULL IDENTITY(1,1) PRIMARY Key,
"ProdCode" CHAR(16) NOT NULL, -- product code
"DeptCode" CHAR(2) NOT NULL, -- department code
"Period" INT Not Null,
"ProdName" VARCHAR(40) NOT NULL )

CREATE INDEX "MyIdx" ON dbo."Product_Dim"("ProductCode, "DeptCode",
"Period")

I create a VIEW on this table to combine "ProdCode"+"DeptCode" into a single
'column' and use it as relation/Join to Fact Table.
(this single column is a MUST for use as member key column) :

Create VIEW Product_Dim AS
SELECT ProdCode+DeptCode AS ProductCode, Period, ProdName FROM Product

The question is :
To use "ProdCode+DeptCode" as Member Key Column, is it better to use VIEW
as above ??
or to create a New Column (ProdCode+DeptCode) in the above table ??

Thank you for any help,
Trist





Reply With Quote
  #2  
Old   
Andrea Temporin
 
Posts: n/a

Default Re: Using VIEW as Dimensin Table ? - 06-15-2004 , 02:19 AM






I've never done tests to see wich way is faster but I often use Views to map
"Logical" tables to dimensions and cubes. In this way you can chose a
logical structure to the multidimensional DB and change the way you get the
data from the relational DB just changing the Views without changin' the
multidimensional structure. Afetr changin' the view you just have to refresh
the data.

Andrea
"tristant" <krislioe (AT) cbn (DOT) net.id> ha scritto nel messaggio
news:OJk4ivoUEHA.716 (AT) TK2MSFTNGP11 (DOT) phx.gbl...
Quote:
Hi All,
I have a dimension table, below :
CREATE TABLE dbo."Product"(
"ProductID" INT NOT NULL IDENTITY(1,1) PRIMARY Key,
"ProdCode" CHAR(16) NOT NULL, -- product code
"DeptCode" CHAR(2) NOT NULL, -- department code
"Period" INT Not Null,
"ProdName" VARCHAR(40) NOT NULL )

CREATE INDEX "MyIdx" ON dbo."Product_Dim"("ProductCode, "DeptCode",
"Period")

I create a VIEW on this table to combine "ProdCode"+"DeptCode" into a
single
'column' and use it as relation/Join to Fact Table.
(this single column is a MUST for use as member key column) :

Create VIEW Product_Dim AS
SELECT ProdCode+DeptCode AS ProductCode, Period, ProdName FROM Product

The question is :
To use "ProdCode+DeptCode" as Member Key Column, is it better to use VIEW
as above ??
or to create a New Column (ProdCode+DeptCode) in the above table ??

Thank you for any help,
Trist







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.