SlideShare a Scribd company logo
XII Encontro da comunidade SQLPort
   Name: Gonçalo Chaves
   Alias: Chaves
   Job: Senior Analyst
   Company: Viatecla
   Im: evolution69@msn.com
   Tw: @gchaves
   Hobbies: reading, photo, gaming
   Email: gchaves@viatecla.com
   Communities: xamlpt, pontonetpt, sqlport
“The biggest problem in databases is
         the base data…”
   Main challenges
   Why we don’t care
   Analysis and procedures
   Tools
   Use Cases
   References
   Engineers knows programing but they don’t
    know SQL!
   Rookies don’t thing in scalability!
   High availability
   Scale and Scale
   Trustful transactions
   Performance and tuning
   Maintenance and archiving
   Partitioning
   Data integrity
   The easy path
   Comfort, learning is a painful process
   No professional training
   No time!
   The big truck rule
   Scale and trust aren’t known
   “Microsoft’s lema”
   Don’t know the engine
   Wrong Assumptions
   Re-use views, queries, with no limits
   Data type? What? nvarchar don’t fit in all?
   Unknown Transaction Isolation levels
   Tons of locks on a single query
   Normalization
     Careful to much can be inefficient
   Appropriate Keys and Indexes
   Right Primary and FK’s
     Choose for relations and integrity
   Don’t over on Indexes
     Take’s disk space
     Drop index for bulk insertion
     Some WHERE’s clauses can’t take advantage on ix
     Evaluate and test you ix
   Each Database is a Database
     BETWEEN can be more efficient than operators
     Native functions (Convert, format…)
     Aggregate functions (max, min, count, …)
   The NULL cancer… you must know NULL well
     ISNull can be a painful
     Wrong assumption on fields
     Null datatype vs “Null”
     Non safe transaction
     Logic looseness
   My debug:
     Profiler… yeah it’s heavy but it’s useful!
     TA – tuning advisor
     Activity monitor
     Look for index, keys, fragments,
   Daily, every sql dev is also an sql admin!
     RedGate suite
     QueryExpress (light, keep simple)
     TableDiff.exe
     DMVStats (dataware house)
     SQL Server Cache manager
   DBA? Where?
     SQL Internals Viewer
     SQLQueryStress (in dev or stage scenarios)
     SQLIO Disk Benchmark tool (on server)
   SQL Security
     Roles may be insufficient
     Prevent SQL injection
     Prevent non logic queries that can burn your data
     Remember, it’s more easier broke sql security by
     your app than anything else.
   The devil ….


    SELECT *
   Dam accelerators ….
     ADO.NET
     SQLDATASOURCE
     LINQ to SQL
     Entity Framework …
   Abuses on
     Group by ; Having; Inner join
     Sub queries with sub queries with …
     #temp_table for everything…
     DML cmd’s
     Constraints for everything…
   Good sense
     Know your data           5
   Maintenance                4
     Job your data            3                                Frag
   Integrity vs Performance   2                                Perf
                                                                Disk
                               1
     The balance is the key
                               0
                                   Jan Fev Mar April May June
   Database – xpto
     1500 tables
     2700 stored procedures
     ~1.5 M transaction per day
   Delete in cascade …
     Broke process
     Restart server
   Normalize has needed
   Test your database
   Schedule jobs
   Create Index’s where needed
   Use right tools
     full text search, TA, SSIS
   Avoid triggers
   Partitioning
   Archive data
   Data type right usage
   Think in your transaction mode
   Use safe locks
   Test, application stress and faulty
   Document you DB 
   Keep scripts in safe
   Update your scripts
   Use facts not assumptions
   Cross your test with others
   Right lock safe usage
   Define db architecture
   A good DB start’s on your apps
   Cache is more than welcome
   “The 4 connections challenge..”
   Multiple Environments keep DB’s updated
   Keep your analysis update
 Developers exists in C# not in SQL – Deal with it!
 Train your team – code review; sessions; books
 Use the right tools on right scenarios
 Integrity vs Performance
 Keep in mind security concerns
 Make Maintenance plans – from the beginning
 Usual blog’s / Communities
 SQL 2008 internals
 Write Smart Sql
 SQL For Smarties
 Sql forums … sqlport 
 Thank you all 
 Do right SQL before the pain!
 Follow me at:
  http://pontonetpt.org/blogs/chaves
  http://xamlpt.com/blogs/chaves
 gchaves@viatecla.com
 www.viatecla.com

More Related Content

Similar to Backpack Tools4 Sql Dev (20)

PPTX
Sql good practices
Deepak Mehtani
 
PPTX
Building scalable application with sql server
Chris Adkin
 
PPTX
SQL Server 2012 Best Practices
Microsoft TechNet - Belgium and Luxembourg
 
PPTX
Sql server infernals
Gianluca Sartori
 
PDF
Database development coding standards
Alessandro Baratella
 
PDF
Query Tuning for Database Pros & Developers
Code Mastery
 
PPTX
SQL Server 2008 Development for Programmers
Adam Hutson
 
PPT
Performance Tuning And Optimization Microsoft SQL Database
Tung Nguyen Thanh
 
PDF
Speed up sql
Kaing Menglieng
 
PDF
Sql coding-standard-sqlserver
lochaaaa
 
PDF
CV | Sham Sunder | Data | Database | Business Intelligence | .Net
Sham Sunder
 
PPTX
DEE 431 Introduction to DBMS Slide 1
YOGESH SINGH
 
PDF
Sql Performance Tuning For Developers
sqlserver.co.il
 
PPTX
Enough Blame for System Performance Issues
Mahesh Vallampati
 
PPTX
Data base testing
BugRaptors
 
PPTX
Day2
madamewoolf
 
PPTX
SQL Server Worst Practices - EN
Gianluca Sartori
 
PPTX
Optimizing Application Performance - 2022.pptx
JasonTuran2
 
Sql good practices
Deepak Mehtani
 
Building scalable application with sql server
Chris Adkin
 
SQL Server 2012 Best Practices
Microsoft TechNet - Belgium and Luxembourg
 
Sql server infernals
Gianluca Sartori
 
Database development coding standards
Alessandro Baratella
 
Query Tuning for Database Pros & Developers
Code Mastery
 
SQL Server 2008 Development for Programmers
Adam Hutson
 
Performance Tuning And Optimization Microsoft SQL Database
Tung Nguyen Thanh
 
Speed up sql
Kaing Menglieng
 
Sql coding-standard-sqlserver
lochaaaa
 
CV | Sham Sunder | Data | Database | Business Intelligence | .Net
Sham Sunder
 
DEE 431 Introduction to DBMS Slide 1
YOGESH SINGH
 
Sql Performance Tuning For Developers
sqlserver.co.il
 
Enough Blame for System Performance Issues
Mahesh Vallampati
 
Data base testing
BugRaptors
 
SQL Server Worst Practices - EN
Gianluca Sartori
 
Optimizing Application Performance - 2022.pptx
JasonTuran2
 

Recently uploaded (20)

PDF
Why aren't you using FME Flow's CPU Time?
Safe Software
 
PDF
99 Bottles of Trust on the Wall — Operational Principles for Trust in Cyber C...
treyka
 
PDF
Darley - FIRST Copenhagen Lightning Talk (2025-06-26) Epochalypse 2038 - Time...
treyka
 
PPTX
Reimaginando la Ciberdefensa: De Copilots a Redes de Agentes
Cristian Garcia G.
 
PDF
Kubernetes - Architecture & Components.pdf
geethak285
 
PDF
Supporting the NextGen 911 Digital Transformation with FME
Safe Software
 
PDF
Understanding AI Optimization AIO, LLMO, and GEO
CoDigital
 
PDF
Bitkom eIDAS Summit | European Business Wallet: Use Cases, Macroeconomics, an...
Carsten Stoecker
 
PDF
Simplify Your FME Flow Setup: Fault-Tolerant Deployment Made Easy with Packer...
Safe Software
 
PDF
Quantum Threats Are Closer Than You Think – Act Now to Stay Secure
WSO2
 
PPSX
Usergroup - OutSystems Architecture.ppsx
Kurt Vandevelde
 
PDF
🚀 Let’s Build Our First Slack Workflow! 🔧.pdf
SanjeetMishra29
 
PPTX
01_Approach Cyber- DORA Incident Management.pptx
FinTech Belgium
 
PDF
Optimizing the trajectory of a wheel loader working in short loading cycles
Reno Filla
 
PPTX
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Poster...
Michele Kryston
 
PDF
Automating the Geo-Referencing of Historic Aerial Photography in Flanders
Safe Software
 
PDF
Proactive Server and System Monitoring with FME: Using HTTP and System Caller...
Safe Software
 
PDF
How to Visualize the ​Spatio-Temporal Data Using CesiumJS​
SANGHEE SHIN
 
PPTX
CapCut Pro PC Crack Latest Version Free Free
josanj305
 
PDF
Unlocking FME Flow’s Potential: Architecture Design for Modern Enterprises
Safe Software
 
Why aren't you using FME Flow's CPU Time?
Safe Software
 
99 Bottles of Trust on the Wall — Operational Principles for Trust in Cyber C...
treyka
 
Darley - FIRST Copenhagen Lightning Talk (2025-06-26) Epochalypse 2038 - Time...
treyka
 
Reimaginando la Ciberdefensa: De Copilots a Redes de Agentes
Cristian Garcia G.
 
Kubernetes - Architecture & Components.pdf
geethak285
 
Supporting the NextGen 911 Digital Transformation with FME
Safe Software
 
Understanding AI Optimization AIO, LLMO, and GEO
CoDigital
 
Bitkom eIDAS Summit | European Business Wallet: Use Cases, Macroeconomics, an...
Carsten Stoecker
 
Simplify Your FME Flow Setup: Fault-Tolerant Deployment Made Easy with Packer...
Safe Software
 
Quantum Threats Are Closer Than You Think – Act Now to Stay Secure
WSO2
 
Usergroup - OutSystems Architecture.ppsx
Kurt Vandevelde
 
🚀 Let’s Build Our First Slack Workflow! 🔧.pdf
SanjeetMishra29
 
01_Approach Cyber- DORA Incident Management.pptx
FinTech Belgium
 
Optimizing the trajectory of a wheel loader working in short loading cycles
Reno Filla
 
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Poster...
Michele Kryston
 
Automating the Geo-Referencing of Historic Aerial Photography in Flanders
Safe Software
 
Proactive Server and System Monitoring with FME: Using HTTP and System Caller...
Safe Software
 
How to Visualize the ​Spatio-Temporal Data Using CesiumJS​
SANGHEE SHIN
 
CapCut Pro PC Crack Latest Version Free Free
josanj305
 
Unlocking FME Flow’s Potential: Architecture Design for Modern Enterprises
Safe Software
 
Ad

Backpack Tools4 Sql Dev

  • 1. XII Encontro da comunidade SQLPort
  • 2. Name: Gonçalo Chaves  Alias: Chaves  Job: Senior Analyst  Company: Viatecla  Im: [email protected]  Tw: @gchaves  Hobbies: reading, photo, gaming  Email: [email protected]  Communities: xamlpt, pontonetpt, sqlport
  • 3. “The biggest problem in databases is the base data…”
  • 4. Main challenges  Why we don’t care  Analysis and procedures  Tools  Use Cases  References
  • 5. Engineers knows programing but they don’t know SQL!
  • 6. Rookies don’t thing in scalability!
  • 7. High availability  Scale and Scale  Trustful transactions  Performance and tuning  Maintenance and archiving  Partitioning  Data integrity
  • 8. The easy path  Comfort, learning is a painful process  No professional training  No time!  The big truck rule  Scale and trust aren’t known  “Microsoft’s lema”
  • 9. Don’t know the engine  Wrong Assumptions  Re-use views, queries, with no limits  Data type? What? nvarchar don’t fit in all?  Unknown Transaction Isolation levels  Tons of locks on a single query
  • 10. Normalization  Careful to much can be inefficient  Appropriate Keys and Indexes  Right Primary and FK’s  Choose for relations and integrity
  • 11. Don’t over on Indexes  Take’s disk space  Drop index for bulk insertion  Some WHERE’s clauses can’t take advantage on ix  Evaluate and test you ix
  • 12. Each Database is a Database  BETWEEN can be more efficient than operators  Native functions (Convert, format…)  Aggregate functions (max, min, count, …)
  • 13. The NULL cancer… you must know NULL well  ISNull can be a painful  Wrong assumption on fields  Null datatype vs “Null”  Non safe transaction  Logic looseness
  • 14. My debug:  Profiler… yeah it’s heavy but it’s useful!  TA – tuning advisor  Activity monitor  Look for index, keys, fragments,
  • 15. Daily, every sql dev is also an sql admin!  RedGate suite  QueryExpress (light, keep simple)  TableDiff.exe  DMVStats (dataware house)  SQL Server Cache manager
  • 16. DBA? Where?  SQL Internals Viewer  SQLQueryStress (in dev or stage scenarios)  SQLIO Disk Benchmark tool (on server)
  • 17. SQL Security  Roles may be insufficient  Prevent SQL injection  Prevent non logic queries that can burn your data  Remember, it’s more easier broke sql security by your app than anything else.
  • 18. The devil …. SELECT *
  • 19. Dam accelerators ….  ADO.NET  SQLDATASOURCE  LINQ to SQL  Entity Framework …
  • 20. Abuses on  Group by ; Having; Inner join  Sub queries with sub queries with …  #temp_table for everything…  DML cmd’s  Constraints for everything…
  • 21. Good sense  Know your data 5  Maintenance 4  Job your data 3 Frag  Integrity vs Performance 2 Perf Disk 1  The balance is the key 0 Jan Fev Mar April May June
  • 22. Database – xpto  1500 tables  2700 stored procedures  ~1.5 M transaction per day  Delete in cascade …  Broke process  Restart server
  • 23. Normalize has needed  Test your database  Schedule jobs  Create Index’s where needed  Use right tools  full text search, TA, SSIS
  • 24. Avoid triggers  Partitioning  Archive data  Data type right usage  Think in your transaction mode  Use safe locks  Test, application stress and faulty
  • 25. Document you DB   Keep scripts in safe  Update your scripts  Use facts not assumptions  Cross your test with others  Right lock safe usage  Define db architecture
  • 26. A good DB start’s on your apps  Cache is more than welcome  “The 4 connections challenge..”  Multiple Environments keep DB’s updated  Keep your analysis update
  • 27.  Developers exists in C# not in SQL – Deal with it!  Train your team – code review; sessions; books  Use the right tools on right scenarios  Integrity vs Performance  Keep in mind security concerns  Make Maintenance plans – from the beginning
  • 28.  Usual blog’s / Communities  SQL 2008 internals  Write Smart Sql  SQL For Smarties  Sql forums … sqlport 
  • 29.  Thank you all   Do right SQL before the pain!  Follow me at: http://pontonetpt.org/blogs/chaves http://xamlpt.com/blogs/chaves  [email protected]  www.viatecla.com