SlideShare a Scribd company logo
The biggest loser database Paul Guerin Sydney Convention Centre August 17 2011
The weigh in……. Capacity right-sizing to achieve business outcomes.
Size Starting size 3 years ago = 730GB Size 2 years later = 550GB Total loss = 180GB + 2 years of growth = 850 GB $$$ = GB * num_entities * $/GB = 850 * 8 * $38.50 = $261,800 (over 2 years) $1/4m over 2 years
Growth rate Growth rate was 29 GB/month. Now 12 GB/month…. Less than half the previous growth rate…
Table waste
Unused tables Check for tables that are not used any more Suspect tables may be named: *old, *bkp, etc. Monitor the table for DML activity. v$segment_statistics Analyse the stored procedures for dependencies. dba_source Setup an audit of the table. AUDIT select, insert, delete, update ON <schema.object> Example: A table and its indexes (84GB in total) were identified as unused and dropped.
Tables in use may contain data that has expired. Question: “Do we really need 10 years of data in this table?” Answer: “No, we only need the last 3 months.” If required, archive data using the data pump query clause. expdp hr QUERY=employees:"WHERE dte < sysdate-100" Example: Deleted from a 62GB table then rebuilt  to 5GB.
Direct-path inserts Potential performance benefits to inserting above the HWM. INSERT /*+ append */ INTO …  SELECT * FROM …; Potential problem: Inserts always above the HWM, but deletes are always below the HWM. Low block density results as deleted space is not reused in a direct-path insert. Example: A low block density table rebuilt from 42GB to 2GB.
Table compression OLTP compression (licence required) Conventional compression ALTER TABLE <schema.tablename> NOLOGGING COMPRESS; INSERT /*+ APPEND */ INTO <schema.tablename> SELECT * FROM …..; Tips: Order low cardinality columns first. Order columns with many nulls last (otherwise costs 1 byte per null).
Index waste
Index waste: Many index configurations are possible. Often not well understood by developers and DBAs. Many SQL statements to consider makes analysis laborious. Large potential for index waste and poor DML performance. Start looking for waste by analysing the existing indexes.
SQL statements decide which indexes are used An index on this predicate will not use an index: WHERE x NOT IN (0,1); An index on this predicate may use an index: WHERE x <0 OR (x>0 AND x<1) OR x >1; 										-- equivalent
An index on this predicate will not use an index: WHERE SUBSTR(y, 1, 10) LIKE '610233997600'; An index on this predicate may use an index: WHERE y LIKE '6102339976__';	-- equivalent Opportunities – change the operator to use the index, or drop the index not being used.
Unused indexes hh_agg_bucket$bckt(bucket)				-- 7.5GB hh_agg_bucket$cntrv(cont_id, rev)			-- 6.4GB hh_agg_bucket$exe(execution_number)	-- 4.7GB Analysis & testing No evidence of statements referencing bucket, cont_id, rev. No indexes on foreign keys No column transivity on join statements Found useful access paths only on the 3rd index. Freed 13.9GB by dropping the unused indexes
Redundant indexes SITE$NDX1(datetm, siteid)	-- 32GB SITE$NDX2(siteid, datetm)	-- 34GB Proposition – Only 1 index used for the access path Analysis & testing – Found only used access path on SITE$NDX2. Dropped SITE$NDX1 to free 32GB
NDX$PK(A, B)	/* primary key on this index */ NDX1(A, B, C)	/* can relocate PK to this index */ Proposition A: If SQL statements reference A & B only NDX$PK more efficient than NDX1 NDX1 redundant.
NDX$PK(A, B)	/* primary key on this index */ NDX1(A, B, C)	/* can relocate PK to this index */ Proposition B: If SQL statements reference A, B, and C (via FFIS or FIS) NDX1 more efficient than NDX$PK. NDX$PK redundant, so put PK on NDX1.
NDX$PK(A, B)	/* primary key on this index */ NDX1(A, B, C)	/* can relocate PK to this index */ Proposition C: If SQL statements reference A, B, and C (and FFIS + FIS not present) NDX1 redundant as C doesn’t make the index more unique. Keep NDX$PK.
B-tree compression B-tree indexes can be compressed Low cardinality keys Potential performance benefits for FFIS, FIS, and IRS. ANALYZE INDEX <schema.indexname> VALIDATE STRUCTURE; SELECT name, partition_name, opt_cmpr_count, opt_cmpr_pctsave FROM INDEX_STATS; ALTER INDEX <schema.indexname> REBUILD COMPRESS <#prefix columns>;
Compressed B-tree examples FCASTDTL$FCASTID_DATETIME -- 4.8GB compressed to 2.9GB FCASTDTL$FCASTID_REVISION -- 3.5GB compressed to 1.9GB
Bitmap indexes - already compressed For extreme compression; use bitmap indexes Best for single column low cardinality keys. No cluster factor. Potential performance benefits for FIS. Good for SQLs that aggregate, but few updates and deletes. CREATE BITMAP INDEX <schema.indexname> ON …; Bitmap compression ratio is in the order of 100:1, so a 5GB b-tree may compress to a 0.05GB bitmap.
Last resort - rebuild Rebuilding is not as effective as eliminating…. -- Determine the amount of deleted space inside an index ANALYZE INDEX <schema.indexname> VALIDATE STRUCTURE; -- % of Btree that is deleted. SELECT DECODE(LF_ROWS,0,NULL,ROUND(DEL_LF_ROWS/LF_ROWS*100,1))  FROM INDEX_STATS;
Business outcomes Business outcomes from capacity right-sizing Better database scalability Leads to performance improvements. Lower storage footprint Equates to lower costs. ($1/4m over 2 years) Growth rate reductions are sustainable. Compared to index rebuilding which is often performed over and over again. Good diets - cut the fat, not the muscle
The biggest loser database eval.insync11.com.au

More Related Content

Viewers also liked

Myth busters - performance tuning 101 2007
Myth busters - performance tuning 101 2007Myth busters - performance tuning 101 2007
Myth busters - performance tuning 101 2007paulguerin
 
Explaining the explain_plan
Explaining the explain_planExplaining the explain_plan
Explaining the explain_plan
arief12H
 
Oracle Database 11g vs 12c
Oracle Database 11g vs 12cOracle Database 11g vs 12c
Oracle Database 11g vs 12c
Deiby Gómez
 
Oracle R12 EBS Performance Tuning
Oracle R12 EBS Performance TuningOracle R12 EBS Performance Tuning
Oracle R12 EBS Performance Tuning
Scott Jenner
 
Cooper Oracle 11g Overview
Cooper Oracle 11g OverviewCooper Oracle 11g Overview
Cooper Oracle 11g Overviewmoin_azeem
 
All of the Performance Tuning Features in Oracle SQL Developer
All of the Performance Tuning Features in Oracle SQL DeveloperAll of the Performance Tuning Features in Oracle SQL Developer
All of the Performance Tuning Features in Oracle SQL Developer
Jeff Smith
 
Ten query tuning techniques every SQL Server programmer should know
Ten query tuning techniques every SQL Server programmer should knowTen query tuning techniques every SQL Server programmer should know
Ten query tuning techniques every SQL Server programmer should know
Kevin Kline
 
Oracle RAC 12c Release 2 - Overview
Oracle RAC 12c Release 2 - OverviewOracle RAC 12c Release 2 - Overview
Oracle RAC 12c Release 2 - Overview
Markus Michalewicz
 

Viewers also liked (8)

Myth busters - performance tuning 101 2007
Myth busters - performance tuning 101 2007Myth busters - performance tuning 101 2007
Myth busters - performance tuning 101 2007
 
Explaining the explain_plan
Explaining the explain_planExplaining the explain_plan
Explaining the explain_plan
 
Oracle Database 11g vs 12c
Oracle Database 11g vs 12cOracle Database 11g vs 12c
Oracle Database 11g vs 12c
 
Oracle R12 EBS Performance Tuning
Oracle R12 EBS Performance TuningOracle R12 EBS Performance Tuning
Oracle R12 EBS Performance Tuning
 
Cooper Oracle 11g Overview
Cooper Oracle 11g OverviewCooper Oracle 11g Overview
Cooper Oracle 11g Overview
 
All of the Performance Tuning Features in Oracle SQL Developer
All of the Performance Tuning Features in Oracle SQL DeveloperAll of the Performance Tuning Features in Oracle SQL Developer
All of the Performance Tuning Features in Oracle SQL Developer
 
Ten query tuning techniques every SQL Server programmer should know
Ten query tuning techniques every SQL Server programmer should knowTen query tuning techniques every SQL Server programmer should know
Ten query tuning techniques every SQL Server programmer should know
 
Oracle RAC 12c Release 2 - Overview
Oracle RAC 12c Release 2 - OverviewOracle RAC 12c Release 2 - Overview
Oracle RAC 12c Release 2 - Overview
 

Similar to In Sync11 Presentation The Biggest Loser

Sydney Oracle Meetup - indexes
Sydney Oracle Meetup - indexesSydney Oracle Meetup - indexes
Sydney Oracle Meetup - indexespaulguerin
 
PHP UK 2020 Tutorial: MySQL Indexes, Histograms And other ways To Speed Up Yo...
PHP UK 2020 Tutorial: MySQL Indexes, Histograms And other ways To Speed Up Yo...PHP UK 2020 Tutorial: MySQL Indexes, Histograms And other ways To Speed Up Yo...
PHP UK 2020 Tutorial: MySQL Indexes, Histograms And other ways To Speed Up Yo...
Dave Stokes
 
SQL Server 2008 Development for Programmers
SQL Server 2008 Development for ProgrammersSQL Server 2008 Development for Programmers
SQL Server 2008 Development for Programmers
Adam Hutson
 
10 Reasons to Start Your Analytics Project with PostgreSQL
10 Reasons to Start Your Analytics Project with PostgreSQL10 Reasons to Start Your Analytics Project with PostgreSQL
10 Reasons to Start Your Analytics Project with PostgreSQL
Satoshi Nagayasu
 
Db2 performance tuning for dummies
Db2 performance tuning for dummiesDb2 performance tuning for dummies
Db2 performance tuning for dummies
Angel Dueñas Neyra
 
MySQL Indexing : Improving Query Performance Using Index (Covering Index)
MySQL Indexing : Improving Query Performance Using Index (Covering Index)MySQL Indexing : Improving Query Performance Using Index (Covering Index)
MySQL Indexing : Improving Query Performance Using Index (Covering Index)
Hemant Kumar Singh
 
Database Performance Tuning
Database Performance Tuning Database Performance Tuning
Database Performance Tuning
Arno Huetter
 
Advanced MySQL Query Optimizations
Advanced MySQL Query OptimizationsAdvanced MySQL Query Optimizations
Advanced MySQL Query Optimizations
Dave Stokes
 
PostgreSQL Table Partitioning / Sharding
PostgreSQL Table Partitioning / ShardingPostgreSQL Table Partitioning / Sharding
PostgreSQL Table Partitioning / Sharding
Amir Reza Hashemi
 
15 Ways to Kill Your Mysql Application Performance
15 Ways to Kill Your Mysql Application Performance15 Ways to Kill Your Mysql Application Performance
15 Ways to Kill Your Mysql Application Performance
guest9912e5
 
Performance Tuning Oracle's BI Applications
Performance Tuning Oracle's BI ApplicationsPerformance Tuning Oracle's BI Applications
Performance Tuning Oracle's BI Applications
KPI Partners
 
Top 10 Oracle SQL tuning tips
Top 10 Oracle SQL tuning tipsTop 10 Oracle SQL tuning tips
Top 10 Oracle SQL tuning tips
Nirav Shah
 
Myth busters - performance tuning 102 2008
Myth busters - performance tuning 102 2008Myth busters - performance tuning 102 2008
Myth busters - performance tuning 102 2008paulguerin
 
DataBase Management System Lab File
DataBase Management System Lab FileDataBase Management System Lab File
DataBase Management System Lab File
Uttam Singh Chaudhary
 
Microsoft SQL Server Filtered Indexes & Sparse Columns Feb 2011
Microsoft SQL Server Filtered Indexes & Sparse Columns Feb 2011Microsoft SQL Server Filtered Indexes & Sparse Columns Feb 2011
Microsoft SQL Server Filtered Indexes & Sparse Columns Feb 2011
Mark Ginnebaugh
 
SQL Server 2008 Performance Enhancements
SQL Server 2008 Performance EnhancementsSQL Server 2008 Performance Enhancements
SQL Server 2008 Performance Enhancements
infusiondev
 
PostgreSQL Database Slides
PostgreSQL Database SlidesPostgreSQL Database Slides
PostgreSQL Database Slides
metsarin
 
SQL Tunning
SQL TunningSQL Tunning
SQL Tunning
Dhananjay Goel
 
Mongodb in-anger-boston-rb-2011
Mongodb in-anger-boston-rb-2011Mongodb in-anger-boston-rb-2011
Mongodb in-anger-boston-rb-2011bostonrb
 
Parquet performance tuning: the missing guide
Parquet performance tuning: the missing guideParquet performance tuning: the missing guide
Parquet performance tuning: the missing guide
Ryan Blue
 

Similar to In Sync11 Presentation The Biggest Loser (20)

Sydney Oracle Meetup - indexes
Sydney Oracle Meetup - indexesSydney Oracle Meetup - indexes
Sydney Oracle Meetup - indexes
 
PHP UK 2020 Tutorial: MySQL Indexes, Histograms And other ways To Speed Up Yo...
PHP UK 2020 Tutorial: MySQL Indexes, Histograms And other ways To Speed Up Yo...PHP UK 2020 Tutorial: MySQL Indexes, Histograms And other ways To Speed Up Yo...
PHP UK 2020 Tutorial: MySQL Indexes, Histograms And other ways To Speed Up Yo...
 
SQL Server 2008 Development for Programmers
SQL Server 2008 Development for ProgrammersSQL Server 2008 Development for Programmers
SQL Server 2008 Development for Programmers
 
10 Reasons to Start Your Analytics Project with PostgreSQL
10 Reasons to Start Your Analytics Project with PostgreSQL10 Reasons to Start Your Analytics Project with PostgreSQL
10 Reasons to Start Your Analytics Project with PostgreSQL
 
Db2 performance tuning for dummies
Db2 performance tuning for dummiesDb2 performance tuning for dummies
Db2 performance tuning for dummies
 
MySQL Indexing : Improving Query Performance Using Index (Covering Index)
MySQL Indexing : Improving Query Performance Using Index (Covering Index)MySQL Indexing : Improving Query Performance Using Index (Covering Index)
MySQL Indexing : Improving Query Performance Using Index (Covering Index)
 
Database Performance Tuning
Database Performance Tuning Database Performance Tuning
Database Performance Tuning
 
Advanced MySQL Query Optimizations
Advanced MySQL Query OptimizationsAdvanced MySQL Query Optimizations
Advanced MySQL Query Optimizations
 
PostgreSQL Table Partitioning / Sharding
PostgreSQL Table Partitioning / ShardingPostgreSQL Table Partitioning / Sharding
PostgreSQL Table Partitioning / Sharding
 
15 Ways to Kill Your Mysql Application Performance
15 Ways to Kill Your Mysql Application Performance15 Ways to Kill Your Mysql Application Performance
15 Ways to Kill Your Mysql Application Performance
 
Performance Tuning Oracle's BI Applications
Performance Tuning Oracle's BI ApplicationsPerformance Tuning Oracle's BI Applications
Performance Tuning Oracle's BI Applications
 
Top 10 Oracle SQL tuning tips
Top 10 Oracle SQL tuning tipsTop 10 Oracle SQL tuning tips
Top 10 Oracle SQL tuning tips
 
Myth busters - performance tuning 102 2008
Myth busters - performance tuning 102 2008Myth busters - performance tuning 102 2008
Myth busters - performance tuning 102 2008
 
DataBase Management System Lab File
DataBase Management System Lab FileDataBase Management System Lab File
DataBase Management System Lab File
 
Microsoft SQL Server Filtered Indexes & Sparse Columns Feb 2011
Microsoft SQL Server Filtered Indexes & Sparse Columns Feb 2011Microsoft SQL Server Filtered Indexes & Sparse Columns Feb 2011
Microsoft SQL Server Filtered Indexes & Sparse Columns Feb 2011
 
SQL Server 2008 Performance Enhancements
SQL Server 2008 Performance EnhancementsSQL Server 2008 Performance Enhancements
SQL Server 2008 Performance Enhancements
 
PostgreSQL Database Slides
PostgreSQL Database SlidesPostgreSQL Database Slides
PostgreSQL Database Slides
 
SQL Tunning
SQL TunningSQL Tunning
SQL Tunning
 
Mongodb in-anger-boston-rb-2011
Mongodb in-anger-boston-rb-2011Mongodb in-anger-boston-rb-2011
Mongodb in-anger-boston-rb-2011
 
Parquet performance tuning: the missing guide
Parquet performance tuning: the missing guideParquet performance tuning: the missing guide
Parquet performance tuning: the missing guide
 

Recently uploaded

Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
RinaMondal9
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
Neo4j
 
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
Peter Spielvogel
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
Pierluigi Pugliese
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...
ThomasParaiso2
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 

Recently uploaded (20)

Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
 
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 

In Sync11 Presentation The Biggest Loser

  • 1. The biggest loser database Paul Guerin Sydney Convention Centre August 17 2011
  • 2. The weigh in……. Capacity right-sizing to achieve business outcomes.
  • 3. Size Starting size 3 years ago = 730GB Size 2 years later = 550GB Total loss = 180GB + 2 years of growth = 850 GB $$$ = GB * num_entities * $/GB = 850 * 8 * $38.50 = $261,800 (over 2 years) $1/4m over 2 years
  • 4. Growth rate Growth rate was 29 GB/month. Now 12 GB/month…. Less than half the previous growth rate…
  • 6. Unused tables Check for tables that are not used any more Suspect tables may be named: *old, *bkp, etc. Monitor the table for DML activity. v$segment_statistics Analyse the stored procedures for dependencies. dba_source Setup an audit of the table. AUDIT select, insert, delete, update ON <schema.object> Example: A table and its indexes (84GB in total) were identified as unused and dropped.
  • 7. Tables in use may contain data that has expired. Question: “Do we really need 10 years of data in this table?” Answer: “No, we only need the last 3 months.” If required, archive data using the data pump query clause. expdp hr QUERY=employees:"WHERE dte < sysdate-100" Example: Deleted from a 62GB table then rebuilt to 5GB.
  • 8. Direct-path inserts Potential performance benefits to inserting above the HWM. INSERT /*+ append */ INTO … SELECT * FROM …; Potential problem: Inserts always above the HWM, but deletes are always below the HWM. Low block density results as deleted space is not reused in a direct-path insert. Example: A low block density table rebuilt from 42GB to 2GB.
  • 9. Table compression OLTP compression (licence required) Conventional compression ALTER TABLE <schema.tablename> NOLOGGING COMPRESS; INSERT /*+ APPEND */ INTO <schema.tablename> SELECT * FROM …..; Tips: Order low cardinality columns first. Order columns with many nulls last (otherwise costs 1 byte per null).
  • 11. Index waste: Many index configurations are possible. Often not well understood by developers and DBAs. Many SQL statements to consider makes analysis laborious. Large potential for index waste and poor DML performance. Start looking for waste by analysing the existing indexes.
  • 12. SQL statements decide which indexes are used An index on this predicate will not use an index: WHERE x NOT IN (0,1); An index on this predicate may use an index: WHERE x <0 OR (x>0 AND x<1) OR x >1; -- equivalent
  • 13. An index on this predicate will not use an index: WHERE SUBSTR(y, 1, 10) LIKE '610233997600'; An index on this predicate may use an index: WHERE y LIKE '6102339976__'; -- equivalent Opportunities – change the operator to use the index, or drop the index not being used.
  • 14. Unused indexes hh_agg_bucket$bckt(bucket) -- 7.5GB hh_agg_bucket$cntrv(cont_id, rev) -- 6.4GB hh_agg_bucket$exe(execution_number) -- 4.7GB Analysis & testing No evidence of statements referencing bucket, cont_id, rev. No indexes on foreign keys No column transivity on join statements Found useful access paths only on the 3rd index. Freed 13.9GB by dropping the unused indexes
  • 15. Redundant indexes SITE$NDX1(datetm, siteid) -- 32GB SITE$NDX2(siteid, datetm) -- 34GB Proposition – Only 1 index used for the access path Analysis & testing – Found only used access path on SITE$NDX2. Dropped SITE$NDX1 to free 32GB
  • 16. NDX$PK(A, B) /* primary key on this index */ NDX1(A, B, C) /* can relocate PK to this index */ Proposition A: If SQL statements reference A & B only NDX$PK more efficient than NDX1 NDX1 redundant.
  • 17. NDX$PK(A, B) /* primary key on this index */ NDX1(A, B, C) /* can relocate PK to this index */ Proposition B: If SQL statements reference A, B, and C (via FFIS or FIS) NDX1 more efficient than NDX$PK. NDX$PK redundant, so put PK on NDX1.
  • 18. NDX$PK(A, B) /* primary key on this index */ NDX1(A, B, C) /* can relocate PK to this index */ Proposition C: If SQL statements reference A, B, and C (and FFIS + FIS not present) NDX1 redundant as C doesn’t make the index more unique. Keep NDX$PK.
  • 19. B-tree compression B-tree indexes can be compressed Low cardinality keys Potential performance benefits for FFIS, FIS, and IRS. ANALYZE INDEX <schema.indexname> VALIDATE STRUCTURE; SELECT name, partition_name, opt_cmpr_count, opt_cmpr_pctsave FROM INDEX_STATS; ALTER INDEX <schema.indexname> REBUILD COMPRESS <#prefix columns>;
  • 20. Compressed B-tree examples FCASTDTL$FCASTID_DATETIME -- 4.8GB compressed to 2.9GB FCASTDTL$FCASTID_REVISION -- 3.5GB compressed to 1.9GB
  • 21. Bitmap indexes - already compressed For extreme compression; use bitmap indexes Best for single column low cardinality keys. No cluster factor. Potential performance benefits for FIS. Good for SQLs that aggregate, but few updates and deletes. CREATE BITMAP INDEX <schema.indexname> ON …; Bitmap compression ratio is in the order of 100:1, so a 5GB b-tree may compress to a 0.05GB bitmap.
  • 22. Last resort - rebuild Rebuilding is not as effective as eliminating…. -- Determine the amount of deleted space inside an index ANALYZE INDEX <schema.indexname> VALIDATE STRUCTURE; -- % of Btree that is deleted. SELECT DECODE(LF_ROWS,0,NULL,ROUND(DEL_LF_ROWS/LF_ROWS*100,1)) FROM INDEX_STATS;
  • 23. Business outcomes Business outcomes from capacity right-sizing Better database scalability Leads to performance improvements. Lower storage footprint Equates to lower costs. ($1/4m over 2 years) Growth rate reductions are sustainable. Compared to index rebuilding which is often performed over and over again. Good diets - cut the fat, not the muscle
  • 24. The biggest loser database eval.insync11.com.au