November 23, 2011 at 4:29 am
Hi,
I have my table which is daily partitioned.
When I execute the select query with date as a parameter, for the case 1 (given below) the partition count is 1 where as the partition count is 50 (all the partitions) for the case 2.
case 1. where DT='2011-08-22'
case 2. where RPT_DT={d '2011-08-22'}
If you have come across the scenario, pls help me with the reasons why case 2 fails to use the curresponding partition.
Smitha
November 23, 2011 at 5:51 am
The two queries are for two different columns. My guess, the first is filtering on the partitioning column, the second isn't.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
November 23, 2011 at 6:22 am
Sorry..It was the typo error. Both the filters are on DT column.
🙂
November 23, 2011 at 6:50 am
smitha.bangalore (11/23/2011)
Sorry..It was the typo error. Both the filters are on DT column.
Would you mind in posting full query and execution plan - for both cases as well as base table DDL?
_____________________________________
Pablo (Paul) Berzukov
Author of Understanding Database Administration available at Amazon and other bookstores.
Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply