Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Tools and Tips: From Accidental to Efficient Data Warehouse Developer (SQLSaturday Sacramento)

275 views

Published on

Tools and Tips: From Accidental to Efficient Data Warehouse Developer (Presented at SQLSaturday Sacramento on July 23rd 2016)

Published in: Data & Analytics
  • Be the first to comment

  • Be the first to like this

Tools and Tips: From Accidental to Efficient Data Warehouse Developer (SQLSaturday Sacramento)

  1. 1. Tools and Tips: From Accidental to Efficient Data Warehouse Developer Cathrine Wilhelmsen SQLSaturday Sacramento · July 23rd 2016
  2. 2. Cathrine Wilhelmsen @cathrinew cathrinew.net Data Warehouse Architect Business Intelligence Developer
  3. 3. once upon a time...
  4. 4. how I felt…
  5. 5. how I want to be...
  6. 6. ef·fi·cient Performing or functioning in the best possible manner with the least waste of time and effort why?
  7. 7. SSMS Queries Biml for SSIS what?
  8. 8. Tip #1: Visual Information
  9. 9. Status Bar and Tab Text
  10. 10. Results in Separate Tab
  11. 11. Tab Groups - Vertical
  12. 12. Tab Groups - Horizontal
  13. 13. Split one query in two windows
  14. 14. Tip #2: Shortcuts
  15. 15. Query Shortcuts
  16. 16. Keyboard Shortcuts Assign shortcuts you frequently use Remove shortcuts you accidentally click (no more "ooops") msdn.microsoft.com/en-us/library/ms174205.aspx
  17. 17. HOME END PG UP PG DNCTRL ALT SHIFT TAB Magic keys!
  18. 18. CTRL R Show / Hide Query Results
  19. 19. ALTSHIFT ENTER Toggle Full Screen
  20. 20. TABCTRL Cycle through windows
  21. 21. CTRL U Change database
  22. 22. SHIFTALT Column / Multi-Line Editing
  23. 23. CTRL K CTRL C Comment Line CTRL K CTRL U Uncomment Line Comment / Uncomment
  24. 24. CTRL SHIFT V Last 20 text items copied are saved in memory Cycle through them to paste the text you need Clipboard Ring
  25. 25. Tip #3: Search in SSMS
  26. 26. Free Tool: Redgate SQL Search red-gate.com/products/sql-development/sql-search/
  27. 27. Free Tool: Redgate SQL Search
  28. 28. Redgate SQL Search ApexSQL Search SSMS Tools Pack (Licensed) SSMS Boost SQL Hunting Dog red-gate.com apexsql.com ssmstoolspack.com ssmsboost.com sql-hunting-dog.com Tools: Search in SSMS
  29. 29. Tip #4: Templates and Snippets
  30. 30. Template Browser Drag & Drop Templates Create Templates CTRL ALT T Templates
  31. 31. Replace Template Parameters with actual values CTRL SHIFT M Template Parameters
  32. 32. CTRL K CTRL X Insert Snippet CTRL K CTRL S Surround With Snippet Snippets
  33. 33. Redgate SQL Prompt (Licensed) ApexSQL Complete / Refactor SSMS Tools Pack (Licensed) SSMS Boost Poor Man's T-SQL Formatter dbForge SQL Complete (Licensed) SQL Formatter red-gate.com apexsql.com ssmstoolspack.com ssmsboost.com poorsql.com devart.com/dbforge sql-format.com Advanced Snippets and Formatting
  34. 34. Redgate SQL Prompt Demo
  35. 35. Tip #5: Registered Servers and Multiserver Queries
  36. 36. Registered Servers Save and group servers Is the server running? Multiserver Queries View Registered Servers CTRL ALT G
  37. 37. Manage services from SSMS
  38. 38. Multiserver Queries
  39. 39. Multiserver Queries
  40. 40. Tip #6: SARGable Queries
  41. 41. SARGable Queries "The query can efficiently seek using an index to find the rows searched for in WHERE or JOIN clauses" Compare it to finding a person in a phone book (…let's just pretend we still use phone books…)
  42. 42. SARGable Queries Adama, Lee Adama, William Agathon, Karl Baltar, Gaius Dualla, Anastasia Gaeta, Felix Henderson, Cally Roslin, Laura Thrace, Kara Tigh, Saul Tyrol, Galen Valerii, Sharon Find all rows where Name starts with 'T'
  43. 43. SARGable Queries Adama, Lee Adama, William Agathon, Karl Baltar, Gaius Dualla, Anastasia Gaeta, Felix Henderson, Cally Roslin, Laura Thrace, Kara Tigh, Saul Tyrol, Galen Valerii, Sharon Find all rows where Name starts with 'T'
  44. 44. Non-SARGable Queries "The query has to scan each row in the table to find the rows searched for in WHERE or JOIN clauses" Compare it to finding a person in a phone book (…let's just keep pretending we still use phone books…)
  45. 45. Non-SARGable Queries Adama, Lee Adama, William Agathon, Karl Baltar, Gaius Dualla, Anastasia Gaeta, Felix Henderson, Cally Roslin, Laura Thrace, Kara Tigh, Saul Tyrol, Galen Valerii, Sharon Find all rows where Name contains 'al'
  46. 46. Non-SARGable Queries Adama, Lee Adama, William Agathon, Karl Baltar, Gaius Dualla, Anastasia Gaeta, Felix Henderson, Cally Roslin, Laura Thrace, Kara Tigh, Saul Tyrol, Galen Valerii, Sharon Find all rows where Name contains 'al'
  47. 47. WHERE LEFT(Name,1,1) = 'T' WHERE YEAR(EpisodeDate) = 2005 WHERE EpisodeDate >= '20050101' AND EpisodeDate < '20060101' SARGable or Non-SARGable?
  48. 48. WHERE LEFT(Name,1,1) = 'T' WHERE YEAR(EpisodeDate) = 2005 WHERE EpisodeDate >= '20050101' AND EpisodeDate < '20060101' SARGable or Non-SARGable?
  49. 49. sqlbits.com/Sessions/Event7/Understanding_SARGability_to_make_your_queries_run_faster
  50. 50. Tip #7: Query Analysis
  51. 51. Execution Plans Display Estimated Execution Plan CTRL L Include Actual Execution Plan CTRL M
  52. 52. Execution Plans See how a query will be executed:
  53. 53. Details in Tooltips
  54. 54. Details in Properties
  55. 55. Free Tool: SQL Sentry Plan Explorer sqlsentry.com/products/plan-explorer
  56. 56. Free Tool: SQL Sentry Plan Explorer answers.sqlperformance.com
  57. 57. red-gate.com/books Free Book: SQL Server Execution Plans by Grant Fritchey
  58. 58. Live Query Statistics Include Live Query Statistics
  59. 59. Live Query Statistics Include Live Query Statistics
  60. 60. Tip #8: Query Statistics
  61. 61. Statistics IO SET STATISTICS IO OFF; SET STATISTICS IO ON;
  62. 62. Statistics Time SET STATISTICS TIME OFF; SET STATISTICS TIME ON;
  63. 63. Statistics Time and IO SET STATISTICS TIME, IO ON; SET STATISTICS TIME, IO OFF;
  64. 64. Free Tool: Statistics Parser statisticsparser.com by Richie Rump
  65. 65. Client Statistics Include Client Statistics SHIFT SALT
  66. 66. Client Statistics Compare multiple query executions:
  67. 67. Tip #9: Activity Monitoring
  68. 68. sqlblog.com/blogs/adam_machanic Free Script: sp_WhoIsActive By Adam Machanic
  69. 69. Free Script: sp_WhoIsActive sqlblog.com/blogs/adam_machanic By Adam Machanic
  70. 70. Tip #10: SSIS with Biml
  71. 71. …what do you need me to do after lunch? Of course I can create 200 SSIS Packages!
  72. 72. Business Intelligence Markup Language Easy to read and write XML language Generate SSIS packages from metadata
  73. 73. What do you need? Free add-in for SSDT bidshelper.codeplex.com
  74. 74. …or you can use the new Biml tools Free add-in for SSDT varigence.com/bimlexpress Free online Biml editor bimlonline.com
  75. 75. Create many SSIS packages from one Biml file How does it work?
  76. 76. Biml for SSIS demo
  77. 77. Where can I learn more? Free online training bimlscript.com
  78. 78. …BimlBreak the rest of the week  Biml on Monday…
  79. 79. @cathrinew cathrinew.net linkedin.com/in/cathrinewilhelmsen hi@cathrinew.net slideshare.net/cathrinewilhelmsen Not enough details? Too fast? Don't worry! cathrinew.net/efficient

×