Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2011
    Location
    Columbus, OH
    Posts
    55

    Unanswered: why a 'fetch first 1 rows only' before view query ??

    Hello DB2 friends. This new DBA is looking for some insight into why something is happening.

    When I do an event monitor to troubleshoot slow execution of a query, I see that a fetch of the first row is occurring before the actual statment I'm trying to execute. I can't figure out why it's doing this. I'm sure performance improvements can be made to the view, but the fetch is what appears to be the performance hit.

    Here's some background on what I'm doing:

    I'm calling a function on a SQL Server 2005 database. A federated linked server is used to query a view on DB2 ("DB2 v9.1.0.2", "s070210", "MI00184", Fix Pack "2".) running on Linux ( 6 2 x86_64) as part of the function.

    I checked and SQL Server using a trace and it doesn't appear to be doing anything that would cause the fetch.

    I've attached a recap of the event monitor output and the event monitor output itself.

    Any info would be greatly appreciated. Thanks!!
    Attached Files Attached Files

  2. #2
    Join Date
    Nov 2011
    Posts
    334
    what do you mean "I see that a fetch of the first row is occurring before the actual statment I'm trying to execute"?
    I can not open the word doc. Maybe it is corrupt on your upload progress

  3. #3
    Join Date
    Aug 2011
    Location
    Columbus, OH
    Posts
    55
    I figured out what was happening. The query from SQL Server to DB2 was written with 4 part notation rather than Open Query. This caused SQL Server to determine the execution plan for the DB2 statement rather than just sending the query natively to DB2. The 'fetch first 1 rows' was occuring in conjuction with a several other requests for information about how to format the query.

Posting Permissions

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