Re: Question regarding view



Mangood wrote:
Hi everyone
I'm building datawarehouse using classical star schema. I have
dimension called sellto_dim and second dimension called shipto_dim
which is identical as sellto_dim. My idea is to create only view based
on sellto_table instead of creating second physical table. The question
is if it's possible to add primary key constraint to view and connect
it with foreign key in fact table.
Thanks in advance.

It is possible but it won't do what you want.

First of all if this is a data warehouse you don't need any primary
keys. Referential integrity in the data, coming from your OLTP systems,
should be assured and not DML should be taking place.

You may need constraints, or their indexes, for the optimizer to help
it make good choices but that is quite another matter.

I'd suggest you drop your idea and revisit the design. Two identical
dimensions? Why? (and yes I did read your explanation).
--
Daniel A. Morgan
http://www.psoug.org
damorgan@xxxxxxxxxxxxxxxx
(replace x with u to respond)
.



Relevant Pages

  • Re: struct pointer to a 2D array
    ... >> typedef struct{ ... since row varies fastest (your code stores the second dimension into the ... img_height member so semantically row indexes the second dimension). ...
    (comp.lang.c)
  • Re: Third dimension...
    ... a line is to the second dimension? ... as a point is to the first dimension, ... from it a 4-dimensional cube. ... Similarly, any from larger triangles. ...
    (sci.math)
  • Re: Third dimension...
    ... a line is to the second dimension? ... as a point is to the first dimension, ... from it a 4-dimensional cube. ... tetrahedron, described at:http://bfi.org/node/574 ...
    (sci.math)
  • Re: Third dimension...
    ... a line is to the second dimension? ... as a point is to the first dimension, ... from it a 4-dimensional cube. ... tetrahedron, described at:http://bfi.org/node/574 ...
    (sci.math)
  • Re: what is a data warehouse?
    ... > Someone then recommended "The Data Warehouse Toolkit" by Ralph Kimball. ... and a data warehouse database is denormalized "dimension" tables. ... > ProductID int, ...
    (microsoft.public.sqlserver.datawarehouse)