Trace on database showing double call.

  • We have a badly performing application that our Vendor is struggling to diagnose. I have been doing some work independantly looking at what exactly the database engine is being asked to do in certain circumstances.

    I have various situations were the application hangs as it requests info from the SQL server. I have taken a trace of the database at the point that the issue occurs. A query is run in the application to return various information. I have setup the trace to capture the SQL:Batchcompleted class. I click in the app, wait 4 mins and then the app returns to life with data returned.

    I then look at my trace. I have two identical SQL transactions both taking 2 mins. It appears like the application has run the identical statement twice. With the exception of start and end times the lines in profiler are exactly the same.

    This clearly does not seem right. Why would this happen ? Any thoughts would be great.

    Cheers

  • Sounds as if it is begin run twice by the client.

    Am i correct in assuming that the starttime and endtime are different and contiguous ?



    Clear Sky SQL
    My Blog[/url]

  • Yep endtime of the first call, is 10 milliseconds sooner than the starttime of the second call. Nothing happens inbetween the two calls.

    Same result set from both. Why on earth would you do that ? And how, for a company that has spent months analysing the slow performance, can that not be picked up by the vendor ?

  • Simon AV (11/30/2009)


    Yep endtime of the first call, is 10 milliseconds sooner than the starttime of the second call. Nothing happens inbetween the two calls.

    Same result set from both. Why on earth would you do that ? And how, for a company that has spent months analysing the slow performance, can that not be picked up by the vendor ?

    That seals it then, its being called twice.

    As to why its not been picked up before , Be afraid , be very afraid..... 😉



    Clear Sky SQL
    My Blog[/url]

  • I`ve passed through the vale of afraid and I`m firmly in the dark forest of dismayed.

  • Does it have different session id's? I'm just curious if it's opening a second connection to run the query. But yeah, I've seen it before. We had an app that ran almost every single select query twice. It was a simple code error that resulted in major pain in the DB.

    Get past afraid and be p****d.

    ----------------------------------------------------The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood... Theodore RooseveltThe Scary DBAAuthor of: SQL Server 2017 Query Performance Tuning, 5th Edition and SQL Server Execution Plans, 3rd EditionProduct Evangelist for Red Gate Software

  • Same client processID, as I`m sure you guessed.

    The spanners !

Viewing 7 posts - 1 through 6 (of 6 total)

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