Results 1 to 6 of 6
  1. #1
    Join Date
    Mar 2003
    Posts
    12

    Unanswered: FASTFIRSTROW or OPTION (FAST 1) doesn´t work correctly

    I want to optimize a query for fast retrieval of the first row
    and after the rest of them automatically.

    I used the hint OPTION (FAST 1) but I don't get the hoped results, any idea?


    Thanks.

  2. #2
    Join Date
    Jul 2003
    Location
    The Dark Planet
    Posts
    1,401
    The FASTFIRSTROW optimizer hint caused the optimizer to use the nonclustered index if one matches the ORDER BYclause.
    Try seeing the execution plan to know what is happening ...
    Get yourself a copy of the The Holy Book

    order has no physical Brett in The meaning of a Kaiser . -database data

  3. #3
    Join Date
    May 2003
    Location
    Parsippany NJ
    Posts
    36
    Can you post the query you wrote?

  4. #4
    Join Date
    Mar 2003
    Posts
    12
    I have an index with three columns but the query use only the first two of them.

    Table name = TRIAL_TB

    Index columns= FIELD1, FIELD2, FIELD3

    Query = SELECT * FROM TRIAL_TB WHERE FIELD1='VAL1'
    AND FIELD2>'VAL2' ORDER BY FIELD1, FIELD2, FIELD3

    If I execute the query, it doesn't match with the index and uses the clustered index.

    Then, with the FASTFIRSTROW optimizer hint, it use the index created.

    But, when I try to retrieve the data by cursor, It doesn't return the first row so fast as I want.

    Thanks.

  5. #5
    Join Date
    Jul 2003
    Location
    The Dark Planet
    Posts
    1,401
    What is the size of the table ???
    Get yourself a copy of the The Holy Book

    order has no physical Brett in The meaning of a Kaiser . -database data

  6. #6
    Join Date
    Mar 2003
    Posts
    12
    The table has 214.000 rows approximately and 5 columns.

Posting Permissions

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