Table Scan or Clustered Index scan

  • Hi,

     

    Which is best Table Scan or Clustered Index scan..?? I know clustered Index is best. But the Execution plan result and STATISTICS IO making me to believe Table scan is best...

    I have a table with out clustered index. When i execute a simple select on that table

     

    select * from table_x

     

    it uses table scan.The overall select cost is 0.436

     

    STATISTICS IO

    ==================

    Scan count 1, logical reads 553, physical reads 0, read-ahead reads 72.

     

    same table with clustered index

     

    select cost: 2.33

    STATISTICS IO

    ==================

     Scan count 1, logical reads 3008, physical reads 0, read-ahead reads 0.

     

    if you see the logical read, its much much high with clustered index

     

    Please Help me

     

    Thanks

    Blackangel

  • A clustered index scan is a table scan. If you put  a clustered index on a table you will never actually see a table scan.

    All that happens is that it goes straight to the leaf level of the indexe and scans it and since the leaf level of a clustered index contains the actual data for the table its just the same.

    But to make any use of an index you need to include a where clause that would elimate some of the rows and for which a suitable index existed.

    hth

    David

     

     

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

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