FETCH API_CURSOR0000000000000212

  • hi,

    we have a long running query(for 10-15 mins). Sql text for that session is "FETCH API_CURSOR0000000000000212" ,"FETCH API_CURSOR0000000000000213" what does that mean. the waittype event is pageiolatch_sh.

    this happens when querying a specific period of data. need help pls.

    Regards,
    MShenel

  • Is this just 1 query or a series of queries in a loop (most likely client side)?

  • Is this Dynamics AX by any chance?

  • anthony.green (6/23/2011)


    Is this Dynamics AX by any chance?

    ... I see the same kind of things with Dynamics Nav. Nice application to code in... not the fastest to run queries tho.

  • Yeah its nasty, from what I have heard about the whole Dynamics range, is that it was purchased off a company that was developing the suite for Oracle, obivously Oracle handle's cursors like a dream but SQL isnt so good and MS havn't change the sorce code.

    Not sure how much of that is true, just what I have been told from various sources.

  • anthony.green (6/23/2011)


    Yeah its nasty, from what I have heard about the whole Dynamics range, is that it was purchased off a company that was developing the suite for Oracle, obivously Oracle handle's cursors like a dream but SQL isnt so good and MS havn't change the sorce code.

    Not sure how much of that is true, just what I have been told from various sources.

    I can confirm the RBAR hell part.

    I've recoded Nav reports in SSRS and they run up to 1000 times faster while doing more works (joins, columns and groupings).

  • it is a single query from a third party application.for different dates a can see the full query and completes in 5 secs.

    Regards,
    MShenel

  • So the single query sometimes take 5 seconds and sometimes 15 minutes?

    Are the stats up to date? When was the last stats update and what type of date is being filtered? >> When the date field is being filled is it mostly being filled with GETDATE() or today's date?

  • stats seems to be stale. auto stats wasnot ON for that table. gathering index solved our case. thank you

    Regards,
    MShenel

  • I don't have all the info I asked for but this is where I was going with this >>>

    http://sqlinthewild.co.za/index.php/2011/03/22/statistics-row-estimations-and-the-ascending-date-column/

Viewing 10 posts - 1 through 9 (of 9 total)

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