Login or Sign Up to become a member!
LessThanDot Sit Logo

LessThanDot

Data Management

Less Than Dot is a community of passionate IT professionals and enthusiasts dedicated to sharing technical knowledge, experience, and assistance. Inside you will find reference materials, interesting technical discussions, and expert tips and commentary. Once you register for an account you will have immediate access to the forums and all past articles and commentaries.

LTD Social Sitings

Lessthandot twitter Lessthandot Linkedin Lessthandot friendfeed Lessthandot facebook Lessthandot rss

Note: Watch for social icons on posts by your favorite authors to follow their postings on these and other social sites.

Your profile

    Search

    XML Feeds

    Google Ads

    « SQL Server Quiz, Can You Answer All These?Optimizing with indexing where commonly overlooked »
    comments

    How many times have you done something like this testing speed

    1. Declare @cnt_test bigint
    2. Declare @st datetime
    3. Set @st = getdate()
    4. Set @cnt_test = (Select count(*) From dbo.test_scan)
    5. Select DateDiff(ms,@st,getdate())

    Specifically the DateDiff() in milliseconds to see how long the execution took.

    There is a nice little option in SSMS that I leave on when working on a query over time. It's called Client Statistics. When set on you can get the same results and much more that can help you measure your performance while altering your code. The results will show the same as having the show execution plan on in SSMS as a tab in the results window. The results from client statistics will accumulate over the time you alter your query also. This is a very nice option and valuable when measuring your changes without adding code you will only have to remove. It will even give you an arrow showing in red if your execution time has gone up or green pointing down for improving

    The option in SSMS 2005 can be found here

    In SSMS 2008

    Although the DateDiff and measuring milliseconds and nanoseconds (in 2008) is still required to pinpoint spots in your code, the client statistics measurement is really a nice added review of you query performance.

    About the Author

    Ted Krueger is a SQL Server MVP and has been working in development and database administration for 13+ years. Specialties range from High Availability and Disaster / Recovery setup and testing methods down to custom assembly development for SQL Server Reporting Services. Ted blogs and is also one of the founders of LessThanDot.com technology community. Some of the articles focused on are Backup / Recovery, Security, SSIS and working on SQL Server and using all of the SQL Server features available to create stable and scalable database services. @onpnt Personal Blog over at http://onpnt.wordpress.com/
    Social SitingsTwitterLinkedInLTD RSS Feed
    3299 views
    InstapaperVote on HN

    1 comment

    Comment from: SQLDenis [Member] Email
    *****
    SQLDenis Or if you like shortcuts in SSMS 2005 and 2008 it is
    SHIFT + ALT + S


    03/23/09 @ 13:22

    Leave a comment


    Your email address will not be revealed on this site.

    To mislead the spambots.

    Your URL will be displayed.
    (Line breaks become <br />)
    (Name, email & website)
    (Allow users to contact you through a message form (your email will not be revealed.)