Hi all,
I was wondering it anyone has successfully implemented horizontal table partitioning?
I have written some simple logic to dynamically create, load and drop the partitioned tables ... which seems to work very well.
One thing I have noticed is in development I have defined a date key (integer based) thinking that the joining methodology would take care of the check constraint. But as it turns out ... it doesn't
Noted in the BOL
[blue]
Apply Conditions Directly to the Fact Table
For the best query performance, all queries must place conditions on the filter key directly in the fact table. A query that places the constraint on a second table, such as a Dates dimension table, will include all partitions in the query. Standard star join queries into a UNION ALL fact table work well:
Create star query WHERE clauses in the standard way, by placing conditions on attributes of any dimension table that is not partitioned.
Include attributes from the partitioning dimension (Dates).
Design queries against a partitioned dimensional schema exactly as you would against a non-partitioned schema, with the exception that conditions on dates are most effective when placed directly on the date key in the fact table.
If each partition table has a clustered index with date as the first column in the index, the cost of going to all partitions to resolve an ad hoc query is relatively small. Predefined queries, such as those that generate standard reports or that incrementally update downstream databases, should be written as efficiently as possible.
[/blue]
This is an issue... seeing that it doesn't take advantage of a star schema.
Example
Both FACT_TABLE.PARTITION_KEY and DIMENSION_TABLE.DIMENSION_KEY are indexed.
This result would attempt to include ALL partitioned table verses if you had filtered on the fact table.
Can this be right????
I would assume that the analyzer would be able to build a indexed list from the dimension table based on the where clause then applied that list within a nested loop against the partition table check constraint...
Any Thoughts
Thanks
TalenX
I was wondering it anyone has successfully implemented horizontal table partitioning?
I have written some simple logic to dynamically create, load and drop the partitioned tables ... which seems to work very well.
One thing I have noticed is in development I have defined a date key (integer based) thinking that the joining methodology would take care of the check constraint. But as it turns out ... it doesn't
Noted in the BOL
[blue]
Apply Conditions Directly to the Fact Table
For the best query performance, all queries must place conditions on the filter key directly in the fact table. A query that places the constraint on a second table, such as a Dates dimension table, will include all partitions in the query. Standard star join queries into a UNION ALL fact table work well:
Create star query WHERE clauses in the standard way, by placing conditions on attributes of any dimension table that is not partitioned.
Include attributes from the partitioning dimension (Dates).
Design queries against a partitioned dimensional schema exactly as you would against a non-partitioned schema, with the exception that conditions on dates are most effective when placed directly on the date key in the fact table.
If each partition table has a clustered index with date as the first column in the index, the cost of going to all partitions to resolve an ad hoc query is relatively small. Predefined queries, such as those that generate standard reports or that incrementally update downstream databases, should be written as efficiently as possible.
[/blue]
This is an issue... seeing that it doesn't take advantage of a star schema.
Example
Code:
SELECT * FROM FACT_TABLE
INNER JOIN DIMENSION_TABLE
ON
PARTITION_KEY = DIMENSION_KEY
WHERE DIMENSION_NAME = 'XYZ'
This result would attempt to include ALL partitioned table verses if you had filtered on the fact table.
Can this be right????
I would assume that the analyzer would be able to build a indexed list from the dimension table based on the where clause then applied that list within a nested loop against the partition table check constraint...
Any Thoughts
Thanks
TalenX