Statistics Use differences between Qry Analyzer & ADO app

  • The database I am supporting seems to be using statistical information differently between Query Analyzer & a web app that comes in through ADO. Specifically a query I  run in Query Analyzer will return 400 rows in 2 seconds and the same query excuted by the web app through ADO will time out (execution time greater than 30 seconds). After I run sp_updatestats both will return results in 2 seconds. Does ADO use statistical info differently than Query Analyzer? I thought the execution plan & statistics would be used in the same way...

  • Hi,

    The first difference is that it is 2 different users running the show, you personally in Query Analyzer and the application login for the Web App. There may be many places between web front end and the database where delays could be. The best way to determine is to run a profiler and see what is the actual query execution time by TSQL SQL-BatchStarting/ SQL-BatchCompleted events. Normally they say you need just BatchCompleted, but for the statements that don't finish you need to use BatchStarting event. Then you will see if the delay is actually in the database or in getting from the web to the database

     

    Regards,Yelena Varsha

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

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