unraveling tangled code n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Unraveling Tangled Code PowerPoint Presentation
Download Presentation
Unraveling Tangled Code

Loading in 2 Seconds...

play fullscreen
1 / 17

Unraveling Tangled Code - PowerPoint PPT Presentation


  • 108 Views
  • Uploaded on

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

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Unraveling Tangled Code' - makana


Download Now 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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
unraveling tangled code

Unraveling Tangled Code

Jen McCown, Jen@MidnightDBA.com

SQLSaturday#223 Oklahoma | 8/24/2013

jen mccown

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

unraveling tangled code1

Unraveling Tangled Code

Jen McCown, Jen@MidnightDBA.com

SQLSaturday#223 Oklahoma | 8/24/2013

overview whee

Organize

  • Breakdown
  • Streamline
Overview! Whee!!

Jen McCown | Unraveling Tangled CodeSQLSaturday#223 Oklahoma | 8/24/2013

overview organize

Format

  • Comment
Overview: Organize

Jen McCown | Unraveling Tangled CodeSQLSaturday#223 Oklahoma | 8/24/2013

overview breakdown

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

overview breakdown1

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

query shape union
Query Shape: UNION

Jen McCown | Tangled Code| July 2011

query shape ctes
Query Shape: CTEs

Jen McCown | Tangled Code| July 2011

query shape subqueries
Query Shape: Subqueries

Jen McCown | Tangled Code| July 2011

overview breakdown2

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

overview breakdown3

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

sketch pbm subquery
Sketch: PBM Subquery

Jen McCown | Tangled Code| July 2011

sketch rankedpurchases subquery
Sketch: RankedPurchasesSubquery

Jen McCown | Tangled Code| July 2011

overview streamline

Obvious Issues

    • Extra rows or columns
    • Unnecessary work
    • NonSARGable WHERE clauses
  • Streamline JOINs
  • Similar Subqueries
  • Other
Overview: Streamline

Jen McCown | Tangled Code| July 2011

summary

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

thanks

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