Presentation is loading. Please wait.

Presentation is loading. Please wait.

Are You There, DBA? It’s Me, The App Developer.

Similar presentations


Presentation on theme: "Are You There, DBA? It’s Me, The App Developer."— Presentation transcript:

1 Are You There, DBA? It’s Me, The App Developer

2 Who am I? Jacquelyn Keeper C#, ASP.NET, SQL Server, Oracle
gmail.com Strategies Common roadblocks

3 DBA vs. Developer Relationship can be contentious Blame game
Us or them Work as a team or everyone goes down with the ship. Us v them Dba dev roles users

4 Developers: How to Ask For Data
Provide the query Reasonable result size Specify output format Destructive or long-running query? Warn the DBA! Use app name in connection string

5 DBAs: How to Provide Data
No screenshots Readable format Takeaway

6 Request/Provide Data Takeaways
Few minutes work up front No wasted time or s

7 Breaking Out of Your Bubble
What causes DBAs and Devs to observe different results?

8 Parameter Sniffing When a stored procedure is compiled, SQL Server uses the parameter values to create an execution plan.

9 Parameter Sniffing Demo

10 Parameter Sniffing – Demo Screenshot
“USA” as First Parameter “Canada” as Second Parameter

11 Parameter Sniffing – Demo Screenshot
“Canada” as First Parameter “USA” as Second Parameter

12 Parameter Sniffing - Takeaways
Performance can vary significantly depending on your parameter values Make sure DBA and Developer use the same parameter values when troubleshooting

13 Breaking Out of Your Bubble - Take 2
What causes DBAs and Devs to observe different results?

14 Different Clients, Different Plans
Even when executing a stored procedure using the same parameter values, an application may get a different query plan than SSMS. Different clients, different plans? Different plans, different results?

15 Default Cache Key Settings
Applications using ADO.NET, ODBC, or OLE DB SSMS SQLCMD, BCP, SQL Server Agent QUOTED_IDENTIFIER ON OFF ARITHABORT Source: Slow in the Application, Fast in SSMS? Understanding Performance Mysteries,

16 Query Plan Cache Demo Clear query cache. Run proc from SSMS. Show query cache. Rerun proc from SSMS with different parameter value. Show query cache. Run proc from SSMS. Show query cache.

17 Query Plan Cache – Demo Screenshot
Stored procedure executed twice, only 1 plan in cache

18 Query Plan Cache – Demo Screenshot
Run stored procedure from application, 2 plans in cache

19 Detour – My demos aren’t working?!?
Plan cache getting cleared within in a few seconds! Check SQL Server error log KB might be affecting you too! Lock pages in memory option

20 Getting the Execution Plan
Get the actual plan, not the estimate Use Profiler to capture the application query plan Using Profiler can cause performance issues!

21 Actual Execution Plan Demo
Have a template ready with the correct events selected

22 Actual Execution Plan – Demo Screenshot

23 Reading the Execution Plan
SQL Sentry Plan Explorer Integrates with SSMS

24 Techniques for troubleshooting together
Tips & Tricks Techniques for troubleshooting together

25 Statistics DBA Consider a weekly or monthly job to update statistics.
Developer Some tables may need frequently updated statistics.

26 Compare Execution Plans
SSMS Application

27 Query Types Stored Procedures Use whenever possible Easy to change
Dynamic SQL Sometimes unavoidable Consider using snippets

28 Get Creative Option Recompile Plan Guides Partition Meetup
Force a good plan to be used Option Recompile Work around parameter sniffing Partition Force queries to use a single partition Meetup In person brainstorming session

29 Learn from each other!

30 DBAs & Developers… this is the beginning of a beautiful friendship!

31 Questions? ?

32 I made use of the following resources:
Credits I made use of the following resources: Presentation template by SlidesCarnival The truly excellent article “Slow in the Application, Fast in SSMS? Understanding Performance Mysteries” by Erland Sommarskog


Download ppt "Are You There, DBA? It’s Me, The App Developer."

Similar presentations


Ads by Google