What is Table Scan and Index Seek? ??????

  • What is the best way of Exception handling in SQL Server 2005?

    and

    what is table scan and Index seek?

  • - Check out Try/Catch in Books online (BOL)

     

    - Scan / Seek see BOL "Table and Index Organization", "Reading Pages ", "Nonclustered Index Structures", "Clustered Index Structures", "Heap Structures".

    Basicaly a scan is to read an object from the beginning to the end and a seek is more like a pinpoint action, reading only the rows you actualy need.

    from BOL SQL2000 :

    Index Seek

    The Index Seek logical and physical operator uses the seeking ability of indexes to retrieve rows from a nonclustered index.

    The Argument column contains the name of the nonclustered index being used. It also contains the SEEK) predicate. The storage engine uses the index to process only those rows that satisfy the SEEK) predicate. It optionally may include a WHERE) predicate, which the storage engine will evaluate against all rows that satisfy the SEEK) predicate (it does not use the indexes to do this).

    If the Argument column contains the ORDERED clause, the query processor has determined that the rows must be returned in the order in which the nonclustered index has sorted them. If the ORDERED clause is not present, the storage engine searches the index in the optimal way (which does not guarantee that the output will be sorted). Allowing the output to retain its ordering may be less efficient than producing nonsorted output.

     

    Johan

    Learn to play, play to learn !

    Dont drive faster than your guardian angel can fly ...
    but keeping both feet on the ground wont get you anywhere :w00t:

    - How to post Performance Problems
    - How to post data/code to get the best help[/url]

    - How to prevent a sore throat after hours of presenting ppt

    press F1 for solution, press shift+F1 for urgent solution 😀

    Need a bit of Powershell? How about this

    Who am I ? Sometimes this is me but most of the time this is me

  • TRY.....CATCH exception handling is something that is introduced in SQL Server 2005 to introduce a new paradigm of Error Handling in SQL. However it is a proven and familiar methodology in programming languages. It really a better way of managing the exceptions.

    Coming to your question on Index Seek and Table Scan. Alzdba has given you all hints that you need to research on Books Online to really understand what they mean.

    However just to brief, when you are running a query , a table scan is invoked when there are no suitable Indexes or if your query optimizer believes that a complete table scan is less expensive than running a Index Seek. Index Seek can be alternatively termed as bookmark lookup.

    Thanks

     

    Prasad Bhogadi
    www.inforaise.com

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

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