SlideShare a Scribd company logo
Performance by DesignGuy HarrisonDirector, R&D Melbournewww.guyharrison.net
Introductions
Performance By Design
Save the red-shirt Toad!The Red-shirt Toad is NOT expendable!
Core messageDesign limits performanceArchitecture maps requirements to designMake sure performance requirements are specifiedMake sure architecture allows for performanceMake sure performance requirements are realized
Elements of Performance by Design
Methodology
High performance can mean different thingsSpeed: response time
Efficiency: power consumption
Power: throughput
Not usually easy to change architectures
Poorly defined requirements lead to this:
The twitter lesson
Twitter growth
“Twitter is, fundamentally, a messaging system. Twitter was not architected as a messaging system, however. For expediency's sake, Twitter was built with technologies and practices that are more appropriate to a content management system.”
Patterns of database performanceHard to distinguish patterns at low levels
Validating performance can’t wait...User adoption and growthUI Layer (HTML, JavaScript, Ajax) Middleware layer (J2EE)SQLsDatabase (Tables, views, partitions, etc)
Performance By Design
Database Design
Normalize, but not too far!
Other logical design thoughtsArtificial keysGenerally more efficient than long composite keysNull valuesNot a good idea if you intend to search for “unknown” or “incomplete” valuesNull should not mean somethingBut beneficial as long as you don’t need to look for them. Data typesConstraints on precision can sometimes reduce row lengthsVariable length strings usually betterCarefully consider CLOBs vs long VARCHARs
Logical to Physical: Subtypes“Customers are people too”
Indexing, clustering and weird table typesLots’ of options:B*-Tree indexBitmap indexHash clusterIndex ClusterNested tableIndex Organized TableMost often useful:B*-Tree (concatenated) indexesBitmap indexesHash Clusters
Performance By Design
Concatenated index effectivenessSELECT cust_idFROM sh.customers cWHERE cust_first_name = 'Connor'AND cust_last_name = 'Bishop'AND cust_year_of_birth = 1976;
Concatenated indexing guidleinesCreate a concatenated index for columns from a table that appear together in the WHERE clause.If columns sometimes appear on their own in a WHERE clause, place them at the start of the index.The more selective a column is, the more useful it will be at the leading end of the index (better single key lookups)But indexes compress better when the leading columns are less selective. (better scans) Index skip scans can make use of an index even if the leading columns are not specified, but it’s a poor second choice to a “normal” index range scan.
Bitmap indexes
Bitmap indexes
Performance By Design
Bitmap join performance SELECT SUM (amount_sold)FROM customers JOIN sales s USING (cust_id) WHERE cust_email='flint.jeffreys@company2.com';
Index overhead
Hash ClusterCluster key determines physical location on diskSingle IO lookup by cluster keyMisconfiguration leads to overflow or sparse tables
Hash Cluster vs B-tree index
Hash cluster table scan
Denormalization and partitioningRepeating groups – VARRAYS, nested tablesSummary tables – Materialized Views, Result cacheHorizontal partitioning – Oracle Partition Option In-line aggregations – Dimensions Derived columns – Virtual columnsVertical partitioning Replicated columns - triggers
Summary tablesAggregate queries on big tables often the most expensivePre-computing them makes a lot of senseBalance accuracy with overhead Aggregate QueryMV on COMMITManual SummaryResult set cacheMV stale tolerated AccuracyEfficiency
Vertical partitioning
Physical storage optionsLOB StoragePCTFREECompression Block size Partitioning
Performance By Design
Application Architecture and implementation
The best SQL is no SQL Avoid asking for the same data twice.
11g client side cache CLIENT_RESULT_CACHE_SIZE: this is the amount of memory each client program will dedicate to the cache.Use RESULT_CACHE hint or (11GR2) table propertyOptionally set the CLIENT_RESULT_CACHE_LAG
Parse overheadIt’s easy enough in most programming languages to create a unique SQL for every query:
Bind variables are preferred
Parse overhead reduction
Identifying similar SQLsSee force_matching.sql at www.guyharrison.net
Transaction design Optimistic vs. Pessimistic
Using ORA_ROWSCNSetting ROWDEPENDENCIES will reduce false fails
Network – stored procedures
Network traffic example
Array processing - Fetch
Network overhead – Array processing
Array Insert (Java)
Array Insert: (.NET)
Array Insert – PL/SQL
Thank you
Geek quiz stuff:High probability answers (keep standing if):Know what Alice and Wally have in commonYou know the next number in this series 3 . 1 4   Know what “M” is in E=MC2
Know (or can work out)  your age in hexHave an opinion  about  of ST  vs SW If you know who Leonard McCoy is Think there is an important distinction between Nerd and Geek Can quote  Monty Python …. Other than dead parrot?You’ve ever  watched Jerry Springer
There are more networked devices in your house than people, pets and carsKnow the names of two of Thomas the tank engines friendsKnow the names of any of Angelina and Brad’s babiesLow probability answers: (sit down if you):Have a twitter account # Azure is your new favourite color
You’ve ever played ZorkYou have a favourite Dr Who companion Your favourite is  Sarah Jane   Know your age in binary (or can work it out in your head) You are proficient in some form of assembler
# You are proficient in some for or English There is a rubicks cube in your house Have your own domainHave ever been to AzerothWho is Know who said “Dude I am not your nemesis”
Worn a star trek or star wars costumePlayed a game that uses a non-six  sided diceGet email on my phone – before getting out of bedCalculator watchBinary time piece Was on the internet prior to the WWW
# Met my current partner on lineKnow the next thing in this sequence:  Hydrogen, Helium, Lithuim, Berilium, ….Know what a Gigaquads in a megaquad is
Saw a sci-fi movie more than twice at the movies=========================================================You cleaned up at home before going to work

More Related Content

DOCX
Csc 440 assignment 2 convex hull out tuesday, feb 9th
PPT
Sql injection attacks
PPTX
Building Performance Modeling: How to Use Modeling Analysis to Optimize Desig...
PPT
Building types a new approach
PDF
Rosa Et Al. 2010
PPTX
Novo BINA - Iidentificador de Chamadas via SMS
PPT
Information Skills: 5. Referencing & Copyright (Natural Sciences, Bangor Univ...
PPT
The Use of Query Reformulation to Predict Future User Actions
Csc 440 assignment 2 convex hull out tuesday, feb 9th
Sql injection attacks
Building Performance Modeling: How to Use Modeling Analysis to Optimize Desig...
Building types a new approach
Rosa Et Al. 2010
Novo BINA - Iidentificador de Chamadas via SMS
Information Skills: 5. Referencing & Copyright (Natural Sciences, Bangor Univ...
The Use of Query Reformulation to Predict Future User Actions

Viewers also liked (20)

PPT
Lesson 05 Three Course Requirements
PPTX
Big datacamp2013 share
PDF
Stormwater Management Using State Revolving Funds
PDF
Regulatory, Technical and Modeling Challenges to Developing a Frequency Based...
PPTX
Performance is the new normal 20120426-preso
PPTX
Raising A Child With A Chronic Illness
PPTX
STEM in Motion - BASA Conference
PPT
照片掃描系統
PDF
Municipal Infrastructure: Managing Assets to Capital Improvement Plans
PPTX
Hadoop, Oracle and the big data revolution collaborate 2013
PPT
Internal Search - The Lost Child of Web Analytics
PPT
Profiling a Person With Search Log Data
PDF
Stormwater Utilities: A regional and national perspective on planning and imp...
KEY
Building a Community Around your Blog 2 - Let the Comments be your Content!
DOC
Ket Qua Xet Tuyen Lop 6
PPT
Twitter and EWOM Branding
PPT
Expressionism (final version)
PDF
Supplemental Info: Say on Pay and Dodd Frank 20100723
PPS
Gracias Por Los Amigos1
PDF
Anais
Lesson 05 Three Course Requirements
Big datacamp2013 share
Stormwater Management Using State Revolving Funds
Regulatory, Technical and Modeling Challenges to Developing a Frequency Based...
Performance is the new normal 20120426-preso
Raising A Child With A Chronic Illness
STEM in Motion - BASA Conference
照片掃描系統
Municipal Infrastructure: Managing Assets to Capital Improvement Plans
Hadoop, Oracle and the big data revolution collaborate 2013
Internal Search - The Lost Child of Web Analytics
Profiling a Person With Search Log Data
Stormwater Utilities: A regional and national perspective on planning and imp...
Building a Community Around your Blog 2 - Let the Comments be your Content!
Ket Qua Xet Tuyen Lop 6
Twitter and EWOM Branding
Expressionism (final version)
Supplemental Info: Say on Pay and Dodd Frank 20100723
Gracias Por Los Amigos1
Anais
Ad

Similar to Performance By Design (20)

PPTX
Performance By Design
PDF
Better sq lqueries
PPTX
Boosting MySQL (for starters)
PPTX
"MySQL Boosting - DB Best Practices & Optimization" by José Luis Martínez - C...
PDF
Exalead managing terrabytes
PDF
Five steps perform_2013
PDF
Database Design most common pitfalls
PPT
The thinking persons guide to data warehouse design
PPTX
Relational database concept and technology
PDF
Mentor Your Indexes
PPTX
SQL Server 2012 Best Practices
PDF
'Natural born killers, SQL performance issues to avoid'
PDF
Big Data @ Bodensee Barcamp 2010
PDF
MySQL optimisation Percona LeMug.fr
PPTX
Handling Massive Writes
PPTX
MySQL 101
PPTX
DBMS Modeling & Optimization
PDF
Join-fu: The Art of SQL Tuning for MySQL
PDF
Sql no sql
PDF
Re-inventing the Database: What to Keep and What to Throw Away
Performance By Design
Better sq lqueries
Boosting MySQL (for starters)
"MySQL Boosting - DB Best Practices & Optimization" by José Luis Martínez - C...
Exalead managing terrabytes
Five steps perform_2013
Database Design most common pitfalls
The thinking persons guide to data warehouse design
Relational database concept and technology
Mentor Your Indexes
SQL Server 2012 Best Practices
'Natural born killers, SQL performance issues to avoid'
Big Data @ Bodensee Barcamp 2010
MySQL optimisation Percona LeMug.fr
Handling Massive Writes
MySQL 101
DBMS Modeling & Optimization
Join-fu: The Art of SQL Tuning for MySQL
Sql no sql
Re-inventing the Database: What to Keep and What to Throw Away
Ad

More from Guy Harrison (19)

PPTX
Five database trends - updated April 2015
PPTX
From oracle to hadoop with Sqoop and other tools
PPTX
Thriving and surviving the Big Data revolution
PPTX
Mega trends in information management
PPTX
Hadoop, oracle and the industrial revolution of data
PPTX
Making the most of ssd in oracle11g
PPTX
Oracle sql high performance tuning
PPTX
Hadoop and rdbms with sqoop
PPTX
Next generation databases july2010
PPTX
Optimize oracle on VMware (April 2011)
PPTX
Optimizing Oracle databases with SSD - April 2014
PPTX
Understanding Solid State Disk and the Oracle Database Flash Cache (older ver...
PPTX
High Performance Plsql
PPTX
Optimize Oracle On VMware (Sep 2011)
PPTX
Thanks for the Memory
PPTX
Top 10 tips for Oracle performance
PPTX
How I learned to stop worrying and love Oracle
PPTX
High Performance Plsql
PPTX
Top 10 tips for Oracle performance (Updated April 2015)
Five database trends - updated April 2015
From oracle to hadoop with Sqoop and other tools
Thriving and surviving the Big Data revolution
Mega trends in information management
Hadoop, oracle and the industrial revolution of data
Making the most of ssd in oracle11g
Oracle sql high performance tuning
Hadoop and rdbms with sqoop
Next generation databases july2010
Optimize oracle on VMware (April 2011)
Optimizing Oracle databases with SSD - April 2014
Understanding Solid State Disk and the Oracle Database Flash Cache (older ver...
High Performance Plsql
Optimize Oracle On VMware (Sep 2011)
Thanks for the Memory
Top 10 tips for Oracle performance
How I learned to stop worrying and love Oracle
High Performance Plsql
Top 10 tips for Oracle performance (Updated April 2015)

Recently uploaded (20)

PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
KodekX | Application Modernization Development
PDF
cuic standard and advanced reporting.pdf
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Approach and Philosophy of On baking technology
PDF
Encapsulation theory and applications.pdf
DOCX
The AUB Centre for AI in Media Proposal.docx
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PPT
Teaching material agriculture food technology
PPTX
MYSQL Presentation for SQL database connectivity
PPTX
Cloud computing and distributed systems.
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
sap open course for s4hana steps from ECC to s4
Unlocking AI with Model Context Protocol (MCP)
Review of recent advances in non-invasive hemoglobin estimation
Per capita expenditure prediction using model stacking based on satellite ima...
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
KodekX | Application Modernization Development
cuic standard and advanced reporting.pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Approach and Philosophy of On baking technology
Encapsulation theory and applications.pdf
The AUB Centre for AI in Media Proposal.docx
Understanding_Digital_Forensics_Presentation.pptx
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Teaching material agriculture food technology
MYSQL Presentation for SQL database connectivity
Cloud computing and distributed systems.
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
sap open course for s4hana steps from ECC to s4

Performance By Design

Editor's Notes

  • #6: TelsavsMasseratiLatency vs throughputVolume?Economics?
  • #7: MethodsRequirementsMeasurementPrototypeBenchmarkData modelOptimize physical model to queryDenormalizeIndexing, clustering, partitionApplicationMinimize database accessOptimize database access
  • #9: http://www.steveschmidtracing.com/our-team-5.html
  • #12: Generally not easy to change architectures.....
  • #21: Normal form is the best starting point for an efficient database design. However, don’t go overboard in eliminating redundancy. A normalized data model is one in which any data redundancy has been eliminatedand in which data and relationships are uniquely identifiable by primaryand foreign keys. Although the normalized data model is rarely the final destinationfrom a performance point of view, the normalized data model is almost alwaysthe best starting point. Indeed, failing to normalize your logical model isfrequently a recipe for a poorly performing physical model.Relational theory provides for various levels of normal form, some of whichare of academic interest only. Third normal form is the most commonly adoptednormalization level, and it has the following characteristics:❏ All data in an entity (table) is dependent on the primary key.❏ There should be no repeating groups of attributes (columns).❏ No data in an entity is dependent on only part of the key.❏ No data in an entity is dependent on any nonkey attribute.These characteristics are often remembered through the adage “the key, thewhole key, and nothing but the key.”
  • #23: Subtypes categorize or partition a logical entity and help to classify thetypes of information that is within the entity. A subtype usually has a set of attributesthat are held in common with the parent entity (the super-type) andother attributes that are not shared with the super-type or other subtypes. Figure4-1 shows how a PEOPLE entity could be split into subtypes of CUSTOMERSand EMPLOYEES.When translating entity subtypes into tables, we have the following options:❏ Create tables for the super-type and for each subtype. The super-type tablecontains only columns that are common to both subtypes.❏ Create a table for the super-type only. Attributes from all subtypes becomecolumns in this super-table. Typically, columns from subtype attributes willbe nullable, and a category column indicates the subtype in which a row belongs.❏ Create separate tables for each subtype without creating a table for thesuper-type. Attributes from the super-type are duplicated in each table.The three solutions result in very different performance outcomes. In particular,creating tables for the super-type and each subtype is likely to reduce performancein most circumstances, except where only the super-type is subject to afull table scan. Table 4-1 compares the performance of each of the three solutionsfor common database operations.
  • #50: Remember, you don’t always have control over the network – in particular client side code may sometimes be located anywhere
  • #51: The further the code is (in network terms) from the database, the more the network effects will magnify. You can’t get any closer to the database than being inde the database as PL/SQL