Re: Query performance



Wei,

I'm not sure I made myself clear. I'm running the same queries, either via
ADO.NET or SQL Management Studio.
SQL profiler sees the same queries being executed but the ADO.NET executed
query takes a lot longer to execute.

So for example when the server is SQL 2000 a simple select from a view with
ADO.NET has a reported duration of 420(ms?) in SQL Profiler. The same query
executed from SSMS has a reported duration of 93ms.

Strangely if I switch to SQL 2005 (on a different machine) the same query
takes the same time from both ADO.NET and SSMS.

I can only examine the execution plan in SQL Management Studio, so how could
I tell if different execution plans are being generated from different
connections? And why would there be since it's the same query?

Regards
Phil

"Wei Lu" <weilu@xxxxxxxxxxxxxxxxxxxx> wrote in message
news:VZlMJIeYGHA.888@xxxxxxxxxxxxxxxxxxxxxxxx
Hi Phil,

Thank you for using MSDN Managed Newsgroup Support.

I understand that you want to know why in SQL Profiler, your .Net
Application is reads more Data Page than using the same query in
Management
Studio. If I misunderstood your concern, please feel free to let me know.

Performance Issue can be related to a lot of things.

Do you use index on the tables you are querying?

Also, would you please try to view the Execution Plan in the Management
Studio to see the detail Execution steps.

Basicly, .Net SQL provider will use the ADO.NET to connect to the SQL
Server 2005. I have tested on my side for some .Net Applications and using
the same query in Management Studio. They accessed the same data pages.

Performance issues can be difficult to troubleshoot and resolve in a
newsgroup setting due to the number of variables and the amount of time
required to narrow down possible causes and observe the effects. We will
assist as best as we can, but you may wish to consider contacting CSS for
a
more timely resolution for these type issues.

To obtain the phone numbers for specific technology request please take a
look at the web site listed below.
http://support.microsoft.com/default.aspx?scid=fh;EN-US;PHONENUMBERS

If you are outside the US please see http://support.microsoft.com
for regional support phone numbers.


Thank you for your patience and understanding.

Sincerely,

Wei Lu
Microsoft Online Community Support

==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================
This posting is provided "AS IS" with no warranties, and confers no
rights.



.



Relevant Pages

  • Re: SP runs slower than same query in Query analyzer. Why??
    ... Andrew your reply was useful but I'm quite new to sql server and I'm ... query gives me the results in 3-4 seconds. ... > Keep in mind that the server has to compile a complete execution plan ... > when compiling a plan. ...
    (microsoft.public.sqlserver.clients)
  • Re: JDBC and Stored procedure performance problems
    ... After the SQL statement is executed. ... The second execution may be faster, but the access plan and the access ... After the second execution the data path stays open, ... Further the wait time may depend on the query engine that is used. ...
    (comp.sys.ibm.as400.misc)
  • Re: Using Function Table ? using Sql Server 2008
    ... however I have heard that performance can be evaluated using Execution ... Hm, to evalutate performance as such, run the query with production-size ... look at the query plan, to get an idea of what the problem might be. ... Links for SQL Server Books Online: ...
    (microsoft.public.sqlserver.programming)
  • Re: Query Designer
    ... Also see the thread I started 'Change Type in Management Studio" in this ... | Right now I can create a new query and then right click within the query ... From there I can indeed design ... | the SQL I have created back in the New Query window. ...
    (microsoft.public.sqlserver.tools)
  • RE: ADO.NET RPC Slower than Management Studio
    ... You may want to look at the ARITHABORT settings in SQL management studio. ... but the differences result in different query plans. ...
    (microsoft.public.dotnet.framework.adonet)