Sales Order Entry very slow load

SOLVED

We have an issue where SO Entry is extremely slow to load. I ran a trace using SQL profiler and it appears to occur when a query is made to obtain a list of comm plans (SELECT CommPlanID, CommPlanKey FROM tarCommPlan WHERE CompanyID = X and CompanyID = X). It takes the client a minute and a half to complete this task and this is the only place I see the client stalling. In profiler the trace sits there for 1min 30secs then zooms through to completion.

I tried running the query directly in SQL it is lightning fast.

We have a highly optimized SQL DB and server, so I am left wondering what the issue is. We only have about 8.5k of commission plans, so I don't think that would cause big issues, so maybe this is an issue in the client rather than the server. One thing that strikes me as odd is that the where clause states the CompanyID twice.

I have ruled out customizations by testing on a normal client and on another company. This has been going on for years, so it is not a new occurrence.

Does anyone else have this happen? Once the client is loaded it runs fine. There are no other issues in accessing data as far as I am able to ascertain.

Parents
  • 0

    In your trace are you using sp:StmtStarting and sp:StmntCompleted?  If not add those as well as the query plan XML from the performance events.  The query plan will generate between the two sp: events mentioned.  Re-run your trace and check the query plan as well as the following in the sp:stmntCompleted line:

    • Duration
    • Reads
    • Writes
    • CPU

    This will give you a little more information as to what is occurring.   If the time to complete the statement is quick and the trace hangs on the completed statement in the trace before the next statement records, then I would tend to believe the issue is network/client related and not SQL Server.

  • 0 in reply to LouDavis

    Thanks Lou.

    Yes I'm using those settings. The XML execution plan is less than a second and the command actually being run is

    exec sp_prepexec @p1 output,NULL,N'SELECT CommPlanID, CommPlanKey FROM tarCommPlan WHERE CompanyID = 'X' AND CompanyID = 'X'

    I don't feel it is SQL, so maybe it is just something peculiar in our data that the SO Entry activity does not like. Very strange and frustrating.

Reply
  • 0 in reply to LouDavis

    Thanks Lou.

    Yes I'm using those settings. The XML execution plan is less than a second and the command actually being run is

    exec sp_prepexec @p1 output,NULL,N'SELECT CommPlanID, CommPlanKey FROM tarCommPlan WHERE CompanyID = 'X' AND CompanyID = 'X'

    I don't feel it is SQL, so maybe it is just something peculiar in our data that the SO Entry activity does not like. Very strange and frustrating.

Children