SlideShare a Scribd company logo
BASLE BERN BRUGG DÜSSELDORF FRANKFURT A.M. FREIBURG I.BR. GENEVA
HAMBURG COPENHAGEN LAUSANNE MUNICH STUTTGART VIENNA ZURICH
Designing for Performance:
Database Related Worst Practices
Christian Antognini
SOUG Day, 2 March 2016, Baden (CH)
@ChrisAntognini
Designing for Performance: Database Related Worst Practices2 3/2/2016
Senior principal consultant, trainer and partner
at Trivadis in Zurich (CH)
christian.antognini@trivadis.com
http://antognini.ch
Focus: get the most out of Oracle Database
Logical and physical database design
Query optimizer
Application performance management
Author of Troubleshooting Oracle Performance (Apress, 2008/14)
OakTable Network, Oracle ACE Director
Agenda
Designing for Performance: Database Related Worst Practices3 3/2/2016
1. Introduction
2. Worst Practices
3. Core Messages
Designing for Performance: Database Related Worst Practices4 3/2/2016
Introduction
Where Does This Information Come From?
Designing for Performance: Database Related Worst Practices5 3/2/2016
Personal experience!
I spent most of the last 15 years troubleshooting performance problems.
Hundreds of different projects and applications
A number of industries were involved
According to my experience, most of the database design related
performance problems are caused by a limited number of issues.
In this presentation I cover the top 10
Even though some of them may seem very basic, do not underestimate the number
of systems that are now running and suffering because of them!
Why It’s Important?
Designing for Performance: Database Related Worst Practices6 3/2/2016
Many performance problems can be
avoided with sound planning and
design.
Do the right thing!
There is a widespread lack of
knowledge in our industry!
The same mistakes are made again
and again.
“To err is human, to persist in it, is
diabolical” – Seneca
Designing for Performance: Database Related Worst Practices7 3/2/2016
Source: @peter_berner
It’s not Premature Optimization!
Designing for Performance: Database Related Worst Practices8 3/2/2016
“Premature optimization is the root of all evil” – Donald Knuth
The misconception based on that particular quote is that a developer, initially,
should ignore optimization altogether.
In my opinion, this interpretation is wrong!
My take:
Developers should avoid micro optimizations that have local impact.
Developers should care about optimizations that have global impact, like the design
of a system, the algorithms used to implement the required functionality, or in which
layer a specific processing should be performed.
Designing for Performance: Database Related Worst Practices9 3/2/2016
Worst Practices
Lack of Logical Database Design
Designing for Performance: Database Related Worst Practices10 3/2/2016
Once upon a time, it was considered obvious that one should have a data
architect involved in every development project.
Today, unfortunately, too often I see projects in which no formal database
design is done.
The database is considered a dumb device.
The logical database design depends on the target database engine.
Schema-on-write vs schema-on-read
Implementing Generic Tables
Designing for Performance: Database Related Worst Practices11 3/2/2016
In the quest of flexibility, generic database designs are implemented.
Entity-attribute-value models
XML- and JSON-based designs
Flexibility is tied to performance!
In some situations suboptimal performance might be good enough.
In other situations it might be catastrophic.
Not Using Constraints to Enforce Data Integrity
Designing for Performance: Database Related Worst Practices12 3/2/2016
Constraints are not only fundamental to guarantee data integrity, but they are
also extensively used by query optimizers during the generation of execution
plans.
Cons of checking the constraints at the application level:
More code being written and tested
Potential problems with data integrity
Greater consumption of resources (not always)
Leads to less scalable locking schemes (not always)
Lack of Physical Database Design
Designing for Performance: Database Related Worst Practices13 3/2/2016
It is not uncommon to see projects where the logical design is directly
mapped to the physical design.
The physical database design depends on target database engine.
Heap tables, clustered tables, IOT
Many type of indexes exist
Data partitioning
Do not forget to define and implement a data-archiving concept.
Not Choosing the Right Data Type
Designing for Performance: Database Related Worst Practices14 3/2/2016
In recent years, I have witnessed a disturbing trend in physical database
design: wrong datatype selection.
E.g. VARCHAR2 instead of DATE or TIMESTAMP
There are four main problems related to wrong datatype selection:
Wrong or lacking validation of data
Loss of information
Things do not work as expected
Query optimizer anomalies
Not Using Bind Variables Correctly
Designing for Performance: Database Related Worst Practices15 3/2/2016
From a performance point of view, bind variables introduce both an
advantage and a disadvantage.
Only applies to database engines having a cursor cache.
The advantage of using bind variables is that they allow the sharing of
cursors.
The disadvantage of using bind variables in WHERE clauses, and only in
WHERE clauses, is that crucial information is sometimes hidden from the
query optimizer.
From a security point of view, bind variables prevent the risks associated with
SQL injection.
Not Using Advanced Database Features
Designing for Performance: Database Related Worst Practices16 3/2/2016
High-end database engines provide many advanced features that can
drastically reduce development costs while boosting performance.
E.g. data-centric processing should take place as closely as possible to the data
Leverage your investment by taking advantage of those features as much as
possible.
Most of the time, database-independent applications are not required.
I would recommend to develop a database-independent application only when there
are very good reasons for doing it.
Companies are more likely to change the whole application before changing just the
database engine.
Performing Unnecessary Commits
Designing for Performance: Database Related Worst Practices17 3/2/2016
Commits are operations that call for serialization.
Every operation that leads to serialization inhibits scalability.
Serialization is unwanted and should be minimized as much as possible.
Steadily Opening and Closing Database Connections
Designing for Performance: Database Related Worst Practices18 3/2/2016
Opening a database connection that in turn starts an associated process or
thread on the database server is not a lightweight operation.
Do not underestimate the amount of time and resources required.
A worst-case scenario that I sometimes observe is a web application that opens and
closes a database connection for every request that involves a database access.
Using a pool of connections is of paramount importance.
Opening Too Many Database Connections
Designing for Performance: Database Related Worst Practices19 3/2/2016
A database connection that has an associated process or thread on the
database server is not a lightweight resource.
A processor core cannot efficiently handle many concurrent processes or
threads.
Using a pool of connections of limited size is of paramount importance.
Designing for Performance: Database Related Worst Practices20 3/2/2016
Core Messages
Designing for Performance: Database Related Worst Practices21 3/2/2016
Let’s Face it, Information Technology Is Expensive!
Simple solutions
for simple problems,
elegant solutions
for complex problems.
One Size Fits All?
Designing for Performance: Database Related Worst Practices22 3/2/2016
Use the right tool
for the right job.
Designing for Performance: Database Related Worst Practices23 3/2/2016
Performance Is Not an Option
Optimal performance is not simply a product one can buy
but rather the results of an accurate planning and
a correct implementation.
Questions and Answers
Christian Antognini
Senior Principal Consultant
christian.antognini@trivadis.com
3/2/2016 Designing for Performance: Database Related Worst Practices24

More Related Content

PDF
Oracle Database In-Memory
PDF
Zero data Loss Recovery Appliance
PDF
Internet of Things (IoT)
PDF
Ten Reasons Why Netezza Professionals Should Consider Greenplum
PDF
Nine Publishing: Building a modern infrastructure with the Elastic Stack
PDF
Slides: Start Small, Grow Big with a Unified Scale-Out Infrastructure
PDF
Slide Webinar NetApp 30 Gennaio
PDF
The Pandemic Changes Everything, the Need for Speed and Resiliency
Oracle Database In-Memory
Zero data Loss Recovery Appliance
Internet of Things (IoT)
Ten Reasons Why Netezza Professionals Should Consider Greenplum
Nine Publishing: Building a modern infrastructure with the Elastic Stack
Slides: Start Small, Grow Big with a Unified Scale-Out Infrastructure
Slide Webinar NetApp 30 Gennaio
The Pandemic Changes Everything, the Need for Speed and Resiliency

What's hot (20)

PDF
Revolutionising Storage for your Future Business Requirements
PDF
Building Robust Production Data Pipelines with Databricks Delta
PDF
Consolidate More: High Performance Primary Deduplication in the Age of Abunda...
PPTX
Microsoft Dryad
PDF
Data Fabric: NetApp's Vision for the Future of Data Management
PDF
Reduce Costs and Complexity with Backup-Free Storage
PDF
Reducing the Total Cost of Ownership of Big Data- Impetus White Paper
PDF
A-B-C Strategies for File and Content Brochure
PDF
Big Data – Shining the Light on Enterprise Dark Data
PPSX
The Analytics Data Store: Information Supply Framework
PDF
NetApp enterprise All Flash Storage
PPTX
Data Warehouse in Cloud
PDF
Simplify Data Center Monitoring With a Single-Pane View
PDF
OpenStack at the speed of business with SolidFire & Red Hat
PDF
NetApp FlashAdvantage 3-4-5
PDF
The Architecture of Decoupling Compute and Storage with Alluxio
PDF
The Benefits of Data Fabric
PDF
Tcod a framework for the total cost of big data - december 6 2013 - winte...
PPTX
Breakout: Hadoop and the Operational Data Store
PPTX
In memory computing
Revolutionising Storage for your Future Business Requirements
Building Robust Production Data Pipelines with Databricks Delta
Consolidate More: High Performance Primary Deduplication in the Age of Abunda...
Microsoft Dryad
Data Fabric: NetApp's Vision for the Future of Data Management
Reduce Costs and Complexity with Backup-Free Storage
Reducing the Total Cost of Ownership of Big Data- Impetus White Paper
A-B-C Strategies for File and Content Brochure
Big Data – Shining the Light on Enterprise Dark Data
The Analytics Data Store: Information Supply Framework
NetApp enterprise All Flash Storage
Data Warehouse in Cloud
Simplify Data Center Monitoring With a Single-Pane View
OpenStack at the speed of business with SolidFire & Red Hat
NetApp FlashAdvantage 3-4-5
The Architecture of Decoupling Compute and Storage with Alluxio
The Benefits of Data Fabric
Tcod a framework for the total cost of big data - december 6 2013 - winte...
Breakout: Hadoop and the Operational Data Store
In memory computing
Ad

Viewers also liked (17)

DOCX
Reflexion modulo 3
PDF
Manage OVM Server Sparc
PDF
halaman 8
DOCX
Centros turisticos de Cajamarca
DOCX
Reflexión del pero fiel
DOC
Ficha autoevaluacion trabajo final
PDF
Conocimientos previos proyecto los juegos populares.
PDF
Costs-of-Exclusion-and-Gains-of-Inclusion-Report
PPTX
Rafael rodriguez mapa_mental
PDF
Single Sign-On for APEX apps (Important: latest version on edocr!)
PDF
Trivadis TechEvent 2016 Der Trivadis Weg mit der Cloud von Florian van Keulen...
PPTX
Banking license and payment banks
PDF
Trivadis TechEvent 2016 Introduction to Lagom - another microservice-based fr...
PPTX
Role of New Payment banks and Small banks - Part - 6
DOCX
Payment banks
DOCX
INDIAN FINANCIAL SYSTEM - REFORMS
Reflexion modulo 3
Manage OVM Server Sparc
halaman 8
Centros turisticos de Cajamarca
Reflexión del pero fiel
Ficha autoevaluacion trabajo final
Conocimientos previos proyecto los juegos populares.
Costs-of-Exclusion-and-Gains-of-Inclusion-Report
Rafael rodriguez mapa_mental
Single Sign-On for APEX apps (Important: latest version on edocr!)
Trivadis TechEvent 2016 Der Trivadis Weg mit der Cloud von Florian van Keulen...
Banking license and payment banks
Trivadis TechEvent 2016 Introduction to Lagom - another microservice-based fr...
Role of New Payment banks and Small banks - Part - 6
Payment banks
INDIAN FINANCIAL SYSTEM - REFORMS
Ad

Similar to Designing for performance: Database Related Worst Practices (20)

PDF
Designing for Performance: Database Related Worst Practices
PPTX
Sql server infernals
PDF
Optimizing Your Database Performance | Embarcadero Technologies
PDF
Optimizing Your Database Performance | Embarcadero Technologies
PPTX
Optimizing Application Performance - 2022.pptx
PDF
Tips for Database Performance
PDF
DBTA Case Study on Data Optimization | September 2008
PDF
Database Performance Handling : A comprehensive guide
PPTX
SQLBits VI - Improving database performance by removing the database
PDF
Oracle 0472
PDF
White Paper for OMG! Identifying and Refactoring Common SQL...
PPTX
Top 10 tips for Oracle performance (Updated April 2015)
PDF
Database Performance Improvements Environment Document Requirement Planning A...
PDF
PostgreSQL worst practices, version FOSDEM PGDay 2017 by Ilya Kosmodemiansky
PDF
Query Tuning for Database Pros & Developers
PDF
One Size Doesn't Fit All: The New Database Revolution
PDF
Database story by DevOps
PDF
Sql Performance Tuning For Developers
PDF
Indexes: The neglected performance all rounder
PPTX
SQL Server Worst Practices - EN
Designing for Performance: Database Related Worst Practices
Sql server infernals
Optimizing Your Database Performance | Embarcadero Technologies
Optimizing Your Database Performance | Embarcadero Technologies
Optimizing Application Performance - 2022.pptx
Tips for Database Performance
DBTA Case Study on Data Optimization | September 2008
Database Performance Handling : A comprehensive guide
SQLBits VI - Improving database performance by removing the database
Oracle 0472
White Paper for OMG! Identifying and Refactoring Common SQL...
Top 10 tips for Oracle performance (Updated April 2015)
Database Performance Improvements Environment Document Requirement Planning A...
PostgreSQL worst practices, version FOSDEM PGDay 2017 by Ilya Kosmodemiansky
Query Tuning for Database Pros & Developers
One Size Doesn't Fit All: The New Database Revolution
Database story by DevOps
Sql Performance Tuning For Developers
Indexes: The neglected performance all rounder
SQL Server Worst Practices - EN

More from Trivadis (20)

PDF
Azure Days 2019: Azure Chatbot Development for Airline Irregularities (Remco ...
PDF
Azure Days 2019: Trivadis Azure Foundation – Das Fundament für den ... (Nisan...
PDF
Azure Days 2019: Business Intelligence auf Azure (Marco Amhof & Yves Mauron)
PDF
Azure Days 2019: Master the Move to Azure (Konrad Brunner)
PDF
Azure Days 2019: Keynote Azure Switzerland – Status Quo und Ausblick (Primo A...
PDF
Azure Days 2019: Grösser und Komplexer ist nicht immer besser (Meinrad Weiss)
PDF
Azure Days 2019: Get Connected with Azure API Management (Gerry Keune & Stefa...
PDF
Azure Days 2019: Infrastructure as Code auf Azure (Jonas Wanninger & Daniel H...
PDF
Azure Days 2019: Wie bringt man eine Data Analytics Plattform in die Cloud? (...
PDF
Azure Days 2019: Azure@Helsana: Die Erweiterung von Dynamics CRM mit Azure Po...
PDF
TechEvent 2019: Kundenstory - Kein Angebot, kein Auftrag – Wie Du ein individ...
PDF
TechEvent 2019: Oracle Database Appliance M/L - Erfahrungen und Erfolgsmethod...
PDF
TechEvent 2019: Security 101 für Web Entwickler; Roland Krüger - Trivadis
PDF
TechEvent 2019: Trivadis & Swisscom Partner Angebote; Konrad Häfeli, Markus O...
PDF
TechEvent 2019: DBaaS from Swisscom Cloud powered by Trivadis; Konrad Häfeli ...
PDF
TechEvent 2019: Status of the partnership Trivadis and EDB - Comparing Postgr...
PDF
TechEvent 2019: More Agile, More AI, More Cloud! Less Work?!; Oliver Dörr - T...
PDF
TechEvent 2019: Kundenstory - Vom Hauptmann zu Köpenick zum Polizisten 2020 -...
PDF
TechEvent 2019: Vom Rechenzentrum in die Oracle Cloud - Übertragungsmethoden;...
PDF
TechEvent 2019: The sleeping Power of Data; Eberhard Lösch - Trivadis
Azure Days 2019: Azure Chatbot Development for Airline Irregularities (Remco ...
Azure Days 2019: Trivadis Azure Foundation – Das Fundament für den ... (Nisan...
Azure Days 2019: Business Intelligence auf Azure (Marco Amhof & Yves Mauron)
Azure Days 2019: Master the Move to Azure (Konrad Brunner)
Azure Days 2019: Keynote Azure Switzerland – Status Quo und Ausblick (Primo A...
Azure Days 2019: Grösser und Komplexer ist nicht immer besser (Meinrad Weiss)
Azure Days 2019: Get Connected with Azure API Management (Gerry Keune & Stefa...
Azure Days 2019: Infrastructure as Code auf Azure (Jonas Wanninger & Daniel H...
Azure Days 2019: Wie bringt man eine Data Analytics Plattform in die Cloud? (...
Azure Days 2019: Azure@Helsana: Die Erweiterung von Dynamics CRM mit Azure Po...
TechEvent 2019: Kundenstory - Kein Angebot, kein Auftrag – Wie Du ein individ...
TechEvent 2019: Oracle Database Appliance M/L - Erfahrungen und Erfolgsmethod...
TechEvent 2019: Security 101 für Web Entwickler; Roland Krüger - Trivadis
TechEvent 2019: Trivadis & Swisscom Partner Angebote; Konrad Häfeli, Markus O...
TechEvent 2019: DBaaS from Swisscom Cloud powered by Trivadis; Konrad Häfeli ...
TechEvent 2019: Status of the partnership Trivadis and EDB - Comparing Postgr...
TechEvent 2019: More Agile, More AI, More Cloud! Less Work?!; Oliver Dörr - T...
TechEvent 2019: Kundenstory - Vom Hauptmann zu Köpenick zum Polizisten 2020 -...
TechEvent 2019: Vom Rechenzentrum in die Oracle Cloud - Übertragungsmethoden;...
TechEvent 2019: The sleeping Power of Data; Eberhard Lösch - Trivadis

Recently uploaded (20)

PPTX
The spiral of silence is a theory in communication and political science that...
PDF
Instagram's Product Secrets Unveiled with this PPT
PPTX
2025-08-10 Joseph 02 (shared slides).pptx
PDF
Why Top Brands Trust Enuncia Global for Language Solutions.pdf
PPTX
Emphasizing It's Not The End 08 06 2025.pptx
PPTX
INTERNATIONAL LABOUR ORAGNISATION PPT ON SOCIAL SCIENCE
PPTX
The Effect of Human Resource Management Practice on Organizational Performanc...
PPTX
Impressionism_PostImpressionism_Presentation.pptx
PPTX
worship songs, in any order, compilation
PPTX
nose tajweed for the arabic alphabets for the responsive
PPTX
Human Mind & its character Characteristics
PPTX
Relationship Management Presentation In Banking.pptx
PPTX
Presentation for DGJV QMS (PQP)_12.03.2025.pptx
PPTX
An Unlikely Response 08 10 2025.pptx
PDF
Swiggy’s Playbook: UX, Logistics & Monetization
DOCX
ENGLISH PROJECT FOR BINOD BIHARI MAHTO KOYLANCHAL UNIVERSITY
PPTX
Learning-Plan-5-Policies-and-Practices.pptx
PPTX
Role and Responsibilities of Bangladesh Coast Guard Base, Mongla Challenges
PPTX
BIOLOGY TISSUE PPT CLASS 9 PROJECT PUBLIC
PDF
Parts of Speech Prepositions Presentation in Colorful Cute Style_20250724_230...
The spiral of silence is a theory in communication and political science that...
Instagram's Product Secrets Unveiled with this PPT
2025-08-10 Joseph 02 (shared slides).pptx
Why Top Brands Trust Enuncia Global for Language Solutions.pdf
Emphasizing It's Not The End 08 06 2025.pptx
INTERNATIONAL LABOUR ORAGNISATION PPT ON SOCIAL SCIENCE
The Effect of Human Resource Management Practice on Organizational Performanc...
Impressionism_PostImpressionism_Presentation.pptx
worship songs, in any order, compilation
nose tajweed for the arabic alphabets for the responsive
Human Mind & its character Characteristics
Relationship Management Presentation In Banking.pptx
Presentation for DGJV QMS (PQP)_12.03.2025.pptx
An Unlikely Response 08 10 2025.pptx
Swiggy’s Playbook: UX, Logistics & Monetization
ENGLISH PROJECT FOR BINOD BIHARI MAHTO KOYLANCHAL UNIVERSITY
Learning-Plan-5-Policies-and-Practices.pptx
Role and Responsibilities of Bangladesh Coast Guard Base, Mongla Challenges
BIOLOGY TISSUE PPT CLASS 9 PROJECT PUBLIC
Parts of Speech Prepositions Presentation in Colorful Cute Style_20250724_230...

Designing for performance: Database Related Worst Practices

  • 1. BASLE BERN BRUGG DÜSSELDORF FRANKFURT A.M. FREIBURG I.BR. GENEVA HAMBURG COPENHAGEN LAUSANNE MUNICH STUTTGART VIENNA ZURICH Designing for Performance: Database Related Worst Practices Christian Antognini SOUG Day, 2 March 2016, Baden (CH)
  • 2. @ChrisAntognini Designing for Performance: Database Related Worst Practices2 3/2/2016 Senior principal consultant, trainer and partner at Trivadis in Zurich (CH) christian.antognini@trivadis.com http://antognini.ch Focus: get the most out of Oracle Database Logical and physical database design Query optimizer Application performance management Author of Troubleshooting Oracle Performance (Apress, 2008/14) OakTable Network, Oracle ACE Director
  • 3. Agenda Designing for Performance: Database Related Worst Practices3 3/2/2016 1. Introduction 2. Worst Practices 3. Core Messages
  • 4. Designing for Performance: Database Related Worst Practices4 3/2/2016 Introduction
  • 5. Where Does This Information Come From? Designing for Performance: Database Related Worst Practices5 3/2/2016 Personal experience! I spent most of the last 15 years troubleshooting performance problems. Hundreds of different projects and applications A number of industries were involved According to my experience, most of the database design related performance problems are caused by a limited number of issues. In this presentation I cover the top 10 Even though some of them may seem very basic, do not underestimate the number of systems that are now running and suffering because of them!
  • 6. Why It’s Important? Designing for Performance: Database Related Worst Practices6 3/2/2016 Many performance problems can be avoided with sound planning and design. Do the right thing! There is a widespread lack of knowledge in our industry! The same mistakes are made again and again. “To err is human, to persist in it, is diabolical” – Seneca
  • 7. Designing for Performance: Database Related Worst Practices7 3/2/2016 Source: @peter_berner
  • 8. It’s not Premature Optimization! Designing for Performance: Database Related Worst Practices8 3/2/2016 “Premature optimization is the root of all evil” – Donald Knuth The misconception based on that particular quote is that a developer, initially, should ignore optimization altogether. In my opinion, this interpretation is wrong! My take: Developers should avoid micro optimizations that have local impact. Developers should care about optimizations that have global impact, like the design of a system, the algorithms used to implement the required functionality, or in which layer a specific processing should be performed.
  • 9. Designing for Performance: Database Related Worst Practices9 3/2/2016 Worst Practices
  • 10. Lack of Logical Database Design Designing for Performance: Database Related Worst Practices10 3/2/2016 Once upon a time, it was considered obvious that one should have a data architect involved in every development project. Today, unfortunately, too often I see projects in which no formal database design is done. The database is considered a dumb device. The logical database design depends on the target database engine. Schema-on-write vs schema-on-read
  • 11. Implementing Generic Tables Designing for Performance: Database Related Worst Practices11 3/2/2016 In the quest of flexibility, generic database designs are implemented. Entity-attribute-value models XML- and JSON-based designs Flexibility is tied to performance! In some situations suboptimal performance might be good enough. In other situations it might be catastrophic.
  • 12. Not Using Constraints to Enforce Data Integrity Designing for Performance: Database Related Worst Practices12 3/2/2016 Constraints are not only fundamental to guarantee data integrity, but they are also extensively used by query optimizers during the generation of execution plans. Cons of checking the constraints at the application level: More code being written and tested Potential problems with data integrity Greater consumption of resources (not always) Leads to less scalable locking schemes (not always)
  • 13. Lack of Physical Database Design Designing for Performance: Database Related Worst Practices13 3/2/2016 It is not uncommon to see projects where the logical design is directly mapped to the physical design. The physical database design depends on target database engine. Heap tables, clustered tables, IOT Many type of indexes exist Data partitioning Do not forget to define and implement a data-archiving concept.
  • 14. Not Choosing the Right Data Type Designing for Performance: Database Related Worst Practices14 3/2/2016 In recent years, I have witnessed a disturbing trend in physical database design: wrong datatype selection. E.g. VARCHAR2 instead of DATE or TIMESTAMP There are four main problems related to wrong datatype selection: Wrong or lacking validation of data Loss of information Things do not work as expected Query optimizer anomalies
  • 15. Not Using Bind Variables Correctly Designing for Performance: Database Related Worst Practices15 3/2/2016 From a performance point of view, bind variables introduce both an advantage and a disadvantage. Only applies to database engines having a cursor cache. The advantage of using bind variables is that they allow the sharing of cursors. The disadvantage of using bind variables in WHERE clauses, and only in WHERE clauses, is that crucial information is sometimes hidden from the query optimizer. From a security point of view, bind variables prevent the risks associated with SQL injection.
  • 16. Not Using Advanced Database Features Designing for Performance: Database Related Worst Practices16 3/2/2016 High-end database engines provide many advanced features that can drastically reduce development costs while boosting performance. E.g. data-centric processing should take place as closely as possible to the data Leverage your investment by taking advantage of those features as much as possible. Most of the time, database-independent applications are not required. I would recommend to develop a database-independent application only when there are very good reasons for doing it. Companies are more likely to change the whole application before changing just the database engine.
  • 17. Performing Unnecessary Commits Designing for Performance: Database Related Worst Practices17 3/2/2016 Commits are operations that call for serialization. Every operation that leads to serialization inhibits scalability. Serialization is unwanted and should be minimized as much as possible.
  • 18. Steadily Opening and Closing Database Connections Designing for Performance: Database Related Worst Practices18 3/2/2016 Opening a database connection that in turn starts an associated process or thread on the database server is not a lightweight operation. Do not underestimate the amount of time and resources required. A worst-case scenario that I sometimes observe is a web application that opens and closes a database connection for every request that involves a database access. Using a pool of connections is of paramount importance.
  • 19. Opening Too Many Database Connections Designing for Performance: Database Related Worst Practices19 3/2/2016 A database connection that has an associated process or thread on the database server is not a lightweight resource. A processor core cannot efficiently handle many concurrent processes or threads. Using a pool of connections of limited size is of paramount importance.
  • 20. Designing for Performance: Database Related Worst Practices20 3/2/2016 Core Messages
  • 21. Designing for Performance: Database Related Worst Practices21 3/2/2016 Let’s Face it, Information Technology Is Expensive! Simple solutions for simple problems, elegant solutions for complex problems.
  • 22. One Size Fits All? Designing for Performance: Database Related Worst Practices22 3/2/2016 Use the right tool for the right job.
  • 23. Designing for Performance: Database Related Worst Practices23 3/2/2016 Performance Is Not an Option Optimal performance is not simply a product one can buy but rather the results of an accurate planning and a correct implementation.
  • 24. Questions and Answers Christian Antognini Senior Principal Consultant christian.antognini@trivadis.com 3/2/2016 Designing for Performance: Database Related Worst Practices24