SlideShare una empresa de Scribd logo
1 de 24
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

Más contenido relacionado

Destacado

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_planarief12H
 
Oracle Database 11g vs 12c
Oracle Database 11g vs 12cOracle Database 11g vs 12c
Oracle Database 11g vs 12cDeiby Gómez
 
Oracle R12 EBS Performance Tuning
Oracle R12 EBS Performance TuningOracle R12 EBS Performance Tuning
Oracle R12 EBS Performance TuningScott 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 DeveloperJeff 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 knowKevin Kline
 
Oracle RAC 12c Release 2 - Overview
Oracle RAC 12c Release 2 - OverviewOracle RAC 12c Release 2 - Overview
Oracle RAC 12c Release 2 - OverviewMarkus Michalewicz
 

Destacado (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 a 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 ProgrammersAdam 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 PostgreSQLSatoshi Nagayasu
 
Db2 performance tuning for dummies
Db2 performance tuning for dummiesDb2 performance tuning for dummies
Db2 performance tuning for dummiesAngel 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 OptimizationsDave Stokes
 
PostgreSQL Table Partitioning / Sharding
PostgreSQL Table Partitioning / ShardingPostgreSQL Table Partitioning / Sharding
PostgreSQL Table Partitioning / ShardingAmir 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 Performanceguest9912e5
 
Performance Tuning Oracle's BI Applications
Performance Tuning Oracle's BI ApplicationsPerformance Tuning Oracle's BI Applications
Performance Tuning Oracle's BI ApplicationsKPI Partners
 
Top 10 Oracle SQL tuning tips
Top 10 Oracle SQL tuning tipsTop 10 Oracle SQL tuning tips
Top 10 Oracle SQL tuning tipsNirav Shah
 
Myth busters - performance tuning 102 2008
Myth busters - performance tuning 102 2008Myth busters - performance tuning 102 2008
Myth busters - performance tuning 102 2008paulguerin
 
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 2011Mark Ginnebaugh
 
SQL Server 2008 Performance Enhancements
SQL Server 2008 Performance EnhancementsSQL Server 2008 Performance Enhancements
SQL Server 2008 Performance Enhancementsinfusiondev
 
PostgreSQL Database Slides
PostgreSQL Database SlidesPostgreSQL Database Slides
PostgreSQL Database Slidesmetsarin
 
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 guideRyan Blue
 

Similar a 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
 

Último

Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 

Último (20)

Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 

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