NULL in fact table as FK or ....
Posted: Thu Apr 07, 2005 3:11 am
Hi!
This is not strictly DS question but maybe someone had similar situation.
Let's say we have two dimensions: customer and vendor, and one fact table with columns: customer_id, vendor_id and value.
In one row in fact table we can have reference to customer dim or vendor dim (never to both of them).
Is it better to put in customer and vendor dim row with NULLs in all columns and put into facts foregin key indicates to it
or
put into fact table NULL or "0" (foregin key indicates to nothing) as vendor or customer foregin key??
Is one of theese solutions better for DS project performance or maybe better for future queries to warehouse??
This is not strictly DS question but maybe someone had similar situation.
Let's say we have two dimensions: customer and vendor, and one fact table with columns: customer_id, vendor_id and value.
In one row in fact table we can have reference to customer dim or vendor dim (never to both of them).
Is it better to put in customer and vendor dim row with NULLs in all columns and put into facts foregin key indicates to it
or
put into fact table NULL or "0" (foregin key indicates to nothing) as vendor or customer foregin key??
Is one of theese solutions better for DS project performance or maybe better for future queries to warehouse??