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)
 Partition Elimination without literals

Author  Topic 

parody
Posting Yak Master

111 Posts

Posted - 2011-09-22 : 11:09:10
I am currently testing a partitioning configuration, using actual execution plan identify RunTimePartitionSummary/PartitionsAccessed info.

When a query is run with a literal against the partitioning column the partition elimination works fine (using = and <=). However if the query is joined to a lookup table, with the partitioning column <= to a column in the lookup table and restricting the lookup table with another criteria (so that only one row is returned, the same as if it was a literal) elimination does not occur.

This only seems to happen if the join criteria is <= rather than =, even though the result is the same. Reversing the logic and using between does not work either.

parody
Posting Yak Master

111 Posts

Posted - 2011-09-22 : 11:59:43
Have also tried with cross apply of table function with same result, same execution plan.
Go to Top of Page

parody
Posting Yak Master

111 Posts

Posted - 2011-09-23 : 06:27:30
Anyone?!

This is SQL 2008 SP2 by the way
Go to Top of Page
   

- Advertisement -