In order to store a huge amount of data in a SQL Server 2008 R2 Express database, I am splitting the data to several databases, creating a new “partition” for each month.
This post : http://msdn.microsoft.com/en-us/library/ms190019.aspx shows how to help the query optimizer to find data faster among my partitions.
However, when querying data on my View between dates that only match an empty partition, the query plan shows that it’s seeking among every partitions. I can’t figure out why though.
My view is very simple :
SELECT A.Gohan, B.Goku
FROM [Feb2011].[dbo].[A]
LEFT OUTER JOIN [Feb2011].[dbo].[B]
UNION ALL
SELECT A.Gohan, B.Goku
FROM [Mar2011].[dbo].[A]
LEFT OUTER JOIN [Mar2011].[dbo].[B]
UNION ALL
...
Any clue ?
Partitioned views are not supported in the SQL Server Express edition.
Check SQL Server Features Not Supported in SQL Server Express section of the SQL Server Express Features page on MSDN.