1 / 17

Unraveling Tangled Code

Unraveling Tangled Code. Jen McCown , Jen@MidnightDBA.com SQLSaturday #223 Oklahoma | 8/24/2013. Microsoft SQL Server MVP & DBA MidnightDBA.com Email: Jen@MidnightDBA.com Blog: MidnightDBA.com/Jen Twitter : @MidnightDBA Webshow : DBAs@Midnight Fridays 11pm CST DBARoadmap.com

makana
Download Presentation

Unraveling Tangled Code

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Unraveling Tangled Code Jen McCown, Jen@MidnightDBA.com SQLSaturday#223 Oklahoma | 8/24/2013

  2. Microsoft SQL Server MVP & DBA • MidnightDBA.com • Email: Jen@MidnightDBA.com • Blog: MidnightDBA.com/Jen • Twitter: @MidnightDBA • Webshow: DBAs@Midnight Fridays 11pm CST • DBARoadmap.com • MidnightSQL Consulting Jen McCown Jen McCown | Unraveling Tangled CodeSQLSaturday#223 Oklahoma | 8/24/2013

  3. Unraveling Tangled Code Jen McCown, Jen@MidnightDBA.com SQLSaturday#223 Oklahoma | 8/24/2013

  4. Organize • Breakdown • Streamline Overview! Whee!! Jen McCown | Unraveling Tangled CodeSQLSaturday#223 Oklahoma | 8/24/2013

  5. Format • Comment Overview: Organize Jen McCown | Unraveling Tangled CodeSQLSaturday#223 Oklahoma | 8/24/2013

  6. Pseudocode • Structure and Plan of Attack • Columns and Returned Data • Table Sketch and Re-Engineering Overview: Breakdown Jen McCown | Unraveling Tangled CodeSQLSaturday#223 Oklahoma | 8/24/2013

  7. Pseudocode • Structure and Plan of Attack • Columns and Returned Data • Table Sketch and Re-Engineering Overview: Breakdown Jen McCown | Unraveling Tangled CodeSQLSaturday#223 Oklahoma | 8/24/2013

  8. Query Shape: UNION Jen McCown | Tangled Code| July 2011

  9. Query Shape: CTEs Jen McCown | Tangled Code| July 2011

  10. Query Shape: Subqueries Jen McCown | Tangled Code| July 2011

  11. Pseudocode • Structure and Plan of Attack • Columns and Returned Data • Table Sketch and Re-Engineering Overview: Breakdown Jen McCown | Unraveling Tangled CodeSQLSaturday#223 Oklahoma | 8/24/2013

  12. Pseudocode • Structure and Plan of Attack • Columns and Returned Data • Table Sketch and Re-Engineering Overview: Breakdown Jen McCown | Unraveling Tangled CodeSQLSaturday#223 Oklahoma | 8/24/2013

  13. Sketch: PBM Subquery Jen McCown | Tangled Code| July 2011

  14. Sketch: RankedPurchasesSubquery Jen McCown | Tangled Code| July 2011

  15. Obvious Issues • Extra rows or columns • Unnecessary work • NonSARGable WHERE clauses • Streamline JOINs • Similar Subqueries • Other Overview: Streamline Jen McCown | Tangled Code| July 2011

  16. Format and comment code • Breakdown • Pseudocode • Structure and Plan of Attack • Columns Returned Data • Table Sketch and Re-Engineering • Streamline Summary Jen McCown | Unraveling Tangled CodeSQLSaturday#223 Oklahoma | 8/24/2013

  17. All session materials and recording will be available at MidnightDBA.com/Jen • Contact me: • Jen@MidnightDBA.com • Twitter.com/MidnightDBA • Other resources: • MidnightDBA.com • SQLServerSamples.codeplex.com (AdventureWorks) • SSMSToolsPack.com • Redgate.com • SQLSentry.net/plan-explorer/ Thanks! Jen McCown | Unraveling Tangled CodeSQLSaturday#223 Oklahoma | 8/24/2013

More Related