SlideShare a Scribd company logo
1 of 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

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_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
 

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

Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 

Recently uploaded (20)

Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 

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