Results 1 to 3 of 3

Thread: query plan

  1. #1
    Join Date
    Aug 2003
    Posts
    43

    Unanswered: query plan

    Hi,

    According to my understanding clustered index is supposed to be used by Sybase. For unknown reasons (to me) it is scanning the whole table. Could any one explain this behaviour?

    Thanks
    -Durga
    Indexes on authors table.
    index_name index_description index_keys
    ---------- ----------------- ----------
    auidind clustered, unique located on default au_id
    aunmind nonclustered located on default au_lname,au_fname

    Query is
    select * from authors where au_id > '136-85-3857'

    And the plan shown is

    QUERY PLAN FOR STATEMENT 1 (at line 1).


    STEP 1
    The type of query is SELECT.


    FROM TABLE
    authors
    Nested iteration.
    Table Scan.
    Forward scan.
    Positioning at start of table.
    Using I/O Size 2 Kbytes for data pages.
    With LRU Buffer Replacement Strategy for data pages.

  2. #2
    Join Date
    Aug 2004
    Posts
    42
    If there are few rows in the table it will just do a scan no matter what indexes there are. With very few rows there is no advantage to using the index (it may even mean a few more page accesses then simply scanning the table).

  3. #3
    Join Date
    Aug 2003
    Posts
    43

    query plan

    Quote Originally Posted by Tad Hawkins
    If there are few rows in the table it will just do a scan no matter what indexes there are. With very few rows there is no advantage to using the index (it may even mean a few more page accesses then simply scanning the table).
    Thank you Tad

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •