where does that estimated number come from?

  • Dear all,

    I'm currently troubleshooting performance problem of our ERP software and using SQL trace to identify queries that might cause it.

    I tried to run one of the queries using Management Studio and got this result:

    My question is, where did SQL get that estimated # of rows from?

    The index statistics is up-to-date and looks like this:

    The server is MS SQL Server 2000 SP3a and the table in question has 1,103,030 records.

    Any thoughts will be appreciated.

    Regards,

    David

  • What version of MS Dynamics Nav is this?

    It looks like you have a cross join in that query (FROM tbl1, tbl2 and then no where condition to make a join)

    I can't make any comments on the stats other than you clearly just updated them with fullscan. So those are as good as they can be.

    Any way you can post the full plan? I don't know if you can get the 2005 version of the plan (using ssms). Remote debugging this on 2000 is not the easiest thing.

  • The OPTION(FAST 5) is probably responsible for the estimated rowcount of 5.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Hi Ninja,

    It's Navision version 4 without SP.

    I can assure you it's from single table.

    I tried to conceal our company name but missed a part of it (", PT") in the process πŸ™‚

    I'm afraid I don't understand what you meant by "full plan".

    Do you mean the screenshot without me hovering the mouse over?

    Thanks

  • Hi Jeff..

    You're absolutely right! It was the "FAST 5"...I can't believe I've missed something that obvious πŸ˜€

    Thanks a lot

  • I am not able to find any 'FAST 5' or '(", PT")' anywhere in the thread. What am I missing?

  • Hi Dev,

    If you can see the first screenshot on my opening post, look at the SQL query and there you'll find "FAST 5" and ", PT" πŸ˜›

  • assistan11 (12/21/2011)


    Hi Dev,

    If you can see the first screenshot on my opening post, look at the SQL query and there you'll find "FAST 5" and ", PT" πŸ˜›

    I was assuming you attached something but I can’t see any attachment... :unsure:

  • assistan11 (12/20/2011)


    Hi Ninja,

    It's Navision version 4 without SP.

    I can assure you it's from single table.

    I tried to conceal our company name but missed a part of it (", PT") in the process πŸ™‚

    I'm afraid I don't understand what you meant by "full plan".

    Do you mean the screenshot without me hovering the mouse over?

    Thanks

    I think there's no need for it now.

    In sql 2005+, you can save the graphical plan as a .sqlplan (which is xml). Which you can then upload so that we can open it on our computer with SSMS.

    Unfortunately afaik there's no way to change that behavior in Nav so I don't have any alternatives to offer to you.

  • @ninja Thanks for the tip on saving graphical plan

    @dev Try open http://img100.imageshack.us/img100/9936/42805049.jpg

  • assistan11 (12/20/2011)


    Hi Jeff..

    You're absolutely right! It was the "FAST 5"...I can't believe I've missed something that obvious πŸ˜€

    Thanks a lot

    You should see what I miss before I've had my 2nd cup o' Joe. πŸ™‚

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Thanks for sharing it but I can't access it. Never Mind...

    You got what you were expecting from SSC. Enjoy πŸ˜‰

Viewing 12 posts - 1 through 12 (of 12 total)

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