parameterized queries behaviour on partitioned tables

  • 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.

  • 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.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply