I have table Inventory_Break partitioned on IR_ID (int). I also created a non-clustered index for IR_ID on the table.
When I run the following:
SELECT *
FROM dbo.INVENTORY_BREAK
WHERE IR_ID IN ( 100, 101, 102 )
I get the following execution plan:

It states Table Scan (HEAP). Not quite sure what it means in the context of a partitioned table. I also don't see that it uses any kind of index. And yet, it must, because the query comes back fairly fast (e.g. the table has 6 million rows).
So, my questions are:
- What does Table Scan (HEAP) mean for a partitioned table?
- Does it indeed use an index, perhaps behind the scenes?
- Is there anything I need to do to improve efficiency?

IR_IDis the partitioning column it can just look at the three partitions of interest. Do any of the partitions contain more than oneIR_IDvalue? – Martin Smith Jul 10 '12 at 22:17IR_IDis unique in partition. – AngryHacker Jul 10 '12 at 22:29IR_IDthen AFAIK. It can already tell which partitions contain a particular value from the partitioning metadata and within each partition all rows in the index will have the same value. – Martin Smith Jul 10 '12 at 22:32