Stored Proc with High CPU in Application

  • I have a stored procedure using a view that joins 3 tables. When the SP is used in Query Analyzer, it runs fine (<500 ms of CPU). Using the same SP in a VB application, the CPU usage is nearly 60 seconds!

    When the view is dropped and recreated, the application works Ok initially, then it reverts to the high CPU usage.

    Has anyone seen these symptoms?

  • This was removed by the editor as SPAM

  • This could be any number of things. Is this a server with high utilization, limited memory, I/O bottlenecks....

    How are you determining the CPU utilization?

    The SP doesn't use EXEC() anywhere does it or anything else that will get you recompiles?

    Use profiler for a while to see if you can ID the problem line/statement.

    Are the criteria for the query passed to the SP? Does the SP use EXEC()?

  • 1. Avoid using VB for tasks different than printing integers from 1 to 10.

    2. Try to exec using ADO and some script (javascript) to see timings. When comparing make sure that executing with same parameters and returning same volume of results.

Viewing 4 posts - 1 through 3 (of 3 total)

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