I need to create a partition on my fact table. The parition is based on a column called function_id. This is a int. The values for this can only 1 or 2.
Can anyone show me how i can do this please?
In SQL SERVER 2008 Relational DB..
I did this:
CREATE PARTITION FUNCTION [pfDataSplitOnFunctionID](INT)
AS RANGE LEFT FOR VALUES (1)
CREATE PARTITION SCHEME [psDataSplitOnFunctionID]
AS PARTITION [pfDataSplitOnFunctionID]
ALL TO ([PRIMARY]);
ALTER TABLE fact_revenue ADD CONSTRAINT chkFunctionID CHECK ([Function_ID] IN(1,2));
So I then do this:
SELECT * FROM
where function_id =1
And the query takes the as long as it did before the parition.
Can someone help me understand were im going wrong??
Also do i need to delete the data then apply the partition then reload..
please help me were im going wrong?
View Complete Post