Presentation is loading. Please wait.

Presentation is loading. Please wait.

Agenda Database Development – Best Practices Why Performance Matters ?

Similar presentations


Presentation on theme: "Agenda Database Development – Best Practices Why Performance Matters ?"— Presentation transcript:

1 Agenda Database Development – Best Practices Why Performance Matters ?
Day to Day Real-Time Examples Demos Questions?

2 Why Performance Matters? Poor Performance
Frustrated Clients Annoyed Support Team Finally it comes to you

3 Database Development – Best Practices Reduce the Number of Calls
Original Query

4 Database Development – Best Practices Reduce the Number of Calls
Performance Improvement

5 Database Development – Best Practices Try to Avoid CAST/ CONVERT
Original Query

6 Database Development – Best Practices Try to Avoid CAST/ CONVERT
Performance Improvement

7 Database Development – Best Practices Use Dictionary Tables
Original Query

8 Database Development – Best Practices Use Dictionary Tables
Performance Improvement

9 Database Development – Best Practices Avoid using Sub -Queries or Nested Queries
Original Query

10 Performance Improvement
Database Development – Best Practices Avoid using Sub -Queries or Nested Queries Performance Improvement

11 Database Development – Best Practices Effective Utilization of CTE
Original Query

12 Database Development – Best Practices Effective Utilization of CTE
Performance Improvement

13 Database Development – Best Practices Remove Unnecessary/Unused Variables
Original Query

14 Performance Improvement
Database Development – Best Practices Remove Unnecessary/Unused Variables Performance Improvement

15 Database Development – Best Practices Better Readability
Original Query Performance Improvement

16 Database Development – Best Practices Use Stored Procedures
Maintainability Encapsulation Security Performance Reduce Server/Client Network Traffic Code Reusability Error Handling

17 Writing Comments in a Stored Procedure
Database Development – Best Practices Writing Comments in a Stored Procedure One very helpful thing to do with your stored procedures is to add comments to your code.  This helps you to know what was done and why (for future reference) Also helps other DBAs or developers that may need to make modifications to the code.

18 Database Development – Best Practices
Avoid Using Cursors Resources consumed by Cursors - occupies more resources (memory, IO, CPU) and temporary storage.  Performance Issues - Each time when a row is fetched from the cursor it may result in a network round trip. This uses much more network bandwidth. Repeated network round trips can degrade the speed of the operation using the cursor. How can you avoid Cursors? Using WHILE LOOPS Using temp tables Using User defined functions

19 ALWAYS CONSIDER PERFORMANCE
Database Development – Best Practices Just because your SQL data set has few records currently it doesn’t mean that the data set won’t grow significantly after you move it to production. One common mistake is to run a poorly performing query in development when the system has no users querying and very few records. The query runs fast, because there’s no load on the database server. Then, when the query is promoted to production and run in a busy environment, the query performs poorly and undermines site performance. Always consider performance even if the query seems like it won’t need many resources from the database server. ALWAYS CONSIDER PERFORMANCE Even if the Query seems Simple


Download ppt "Agenda Database Development – Best Practices Why Performance Matters ?"

Similar presentations


Ads by Google