Testing on local database vs remote database

  • I was recently testing a scalar function that returns part of a large xml string when I realized that server location matters.

    When I ran the tests on my local SQL Server instance, It took less than 1 second to fetch the unprocessed xml (function was not called) and 8 seconds when function was called. I was inclined to think that there was still some optimizations that would render my function more efficient. I then ran the tests on a remote SQL Server (similar hardware configuration). Took 11 seconds when the function was called and 17 seconds to fetch the unprocessed xml.

    Turned out that the function was actually efficient and that there was a value running the function on the server in order to minimize network data traffic.

    Since my statements are ultimately executed on a remote server, is there a way, when testing on a local server, to introduce a «fake» delay to mimic network traffic?

    Thanks!

Viewing 0 posts

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