Need help in preparing code review check list for SPs

  • Hi All,

    I am in the process of preparing a code review check list to be shared with my team members. I have planned to improve my team's code review efficiency since often our SPs (stored procedures,User Defined Functions etc) were required to be re-coded/modified for performance hit.

    Could you guys please help me in consolidating the points to be covered in my check list?

    Thanks in advance,

    Suresh

    Regards,
    Suresh Arumugam

  • What's on your list so far?



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • I think first and foremost is formatting.

    Equally important is documentation. Leave notes in the proc. I like to use a header section also that describes what any changes are and what the purpose of the proc is.

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • I agree with Jason...

    Next items:

    Are all objects schema qualified?

    Are aliases defined and used?

    Are there any functions being used in the where clause that would prevent index usage?

    Are there any functions being used in the select list that would cause performance issues?

    Jeffrey Williams
    Problems are opportunities brilliantly disguised as insurmountable obstacles.

    How to post questions to get better answers faster
    Managing Transaction Logs

  • Are you using any catch-all queries?

    Does your code utilize the "WHILE" statement?

    Are recursive CTEs being utilized?

    Have the execution plans for the query been analyzed FOR EACH condition of parameters?

    Do the queries have supporting indexes?

    Wayne
    Microsoft Certified Master: SQL Server 2008
    Author - SQL Server T-SQL Recipes


    If you can't explain to another person how the code that you're copying from the internet works, then DON'T USE IT on a production system! After all, you will be the one supporting it!
    Links:
    For better assistance in answering your questions
    Performance Problems
    Common date/time routines
    Understanding and Using APPLY Part 1 & Part 2

  • Add to the list:

    Any query hints? If so, is it required and the documentation in place explaining why?

    Jeffrey Williams
    Problems are opportunities brilliantly disguised as insurmountable obstacles.

    How to post questions to get better answers faster
    Managing Transaction Logs

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

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