Monday, May 13, 2013

[SQL 2012] Join elimination not working with view

[SQL 2012] Join elimination not working with view


Join elimination not working with view

Posted: 13 May 2013 01:37 AM PDT

It seems that join elimination is not occurring when a table has a foreign key to the table underlying a view. Is there something else I need to do for the optimizer to know the join to a view can be eliminated?In our dimensional model, we have a view for DimApplicationDate that is based on DimDate, simply renaming DateKey to ApplicationDateKey. In my fact table I have a foreign key on ApplicationDateKey that references DateKey in DimDate. If I do not use ApplicationDate in my query, the join to DimDate is still not eliminated. This seems to be the case for all my virtual dimensions.

No comments:

Post a Comment

Search This Blog