Help with tuning application

  • Hi,

    I have an application that is taking a long time to run. I have run a profile against it and noticed the following:

    exec sp_execute 7, N'200000330049'

    select x_coordinate,y_coordinate,local_custodian_code from llpg21_73 where uprn = @P0

    This particular statement takes 4511 Reads according to the profiler output.

    However in SQL via Query Analyzer

    declare @P3 int

    exec sp_prepare @P3 output, N'@P0 varchar(12)', N'select x_coordinate,y_coordinate,local_custodian_code from llpg21_73 where uprn = @P0'

    exec sp_execute @P3, N'200000330049'

    This is the result

    SQL Server Execution Times:

    CPU time = 0 ms, elapsed time = 0 ms.

    SQL Server parse and compile time:

    CPU time = 0 ms, elapsed time = 0 ms.

    Table 'llpg21_73'. Scan count 1, logical reads 3, physical reads 0, read-ahead reads 0.

    SQL Server Execution Times:

    CPU time = 0 ms, elapsed time = 0 ms.

    (1 row(s) affected)

    Profiler shows the query as taking 4511 reads but when run via query analyzer it says 3 logical reads.

    Does anyone have any idea as to why there is such a large difference ?

    Ronnie

  • Here is my cent.

    The number of threads are determined by the setting of your SQL Server. It is not a constant. It depends on the loading on the SQL Server. I do not know how.

    You compared your results of loading from different sources. I do not think it is surprising from the difference. Even running the same command on your QA, you may get different number of logical threads.

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

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