Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 search in partition views

Author  Topic 

santhosh3477
Starting Member

2 Posts

Posted - 2012-05-24 : 09:05:21
i have a partition view with columns as starttime smalldatetime type

while i am using query "select top 10 * from partionview where satrttime>'2012-05-24' it is scanning the tables which are required.

while i am uisng the query "select top 10 * from partionview where satrttime>getdate() it is scanning the tables which are not required.


any suggestions please

robvolk
Most Valuable Yak

15732 Posts

Posted - 2012-05-24 : 09:43:59
Check Books Online under "Creating Partitioned Views". There are several requirements for partition elimination to work, including CHECK constraints on the base tables. You'll need such a constraint on the date column you're partitioning by.
Go to Top of Page
   

- Advertisement -