Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

parameterized queries behaviour on partitioned tables Expand / Collapse
Author
Message
Posted Sunday, June 28, 2009 8:38 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, April 17, 2014 1:36 PM
Points: 1, Visits: 120
how does SQL-Server 2005 behave when i run parameterized queries on a partitioned table?
does the partition pruning mechanism still work or do i need to do something so that the pruning mechanism will continue to work?

for example :
the table RECORDS has four columns :
record_id char(10)
record_type smallint
customer_id smallint
creation_date datetime

and is partitioned by the column customer_id.
if i'll issue the query :
select * from RECORDS where customer_id = : x;
will SQL-Server access all partitions or will it access only the needed partition?
if the first option is true, how can i make it access only the needed partition?

any information on that matter will help.

thanks is advance,
Hanan.
Post #743276
Posted Sunday, June 28, 2009 9:23 PM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Today @ 5:12 PM
Points: 23,081, Visits: 31,618
It should only access the partition where the data resides. Yo should be able to verify this by having SSMS show you the actual execution plan when running the query.




Lynn Pettis

For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here or when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here and here
Managing Transaction Logs

SQL Musings from the Desert Fountain Valley SQL (My Mirror Blog)
Post #743333
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse