Click here to monitor SSC
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase

parameterized queries behaviour on partitioned tables Expand / Collapse
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: Tuesday, December 30, 2014 2:37 PM
Points: 1, Visits: 127
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,
Post #743276
Posted Sunday, June 28, 2009 9:23 PM



Group: General Forum Members
Last Login: Today @ 1:15 PM
Points: 23,522, Visits: 37,750
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