SlideShare ist ein Scribd-Unternehmen logo
1 von 8
Solving MySQL Performance
          Issues
Problems
• Overview
  –   Most of the tables de-normalized / 2nd normal form
  –   Way too many indexes
  –   Missing constraints
  –   No subtype relationships
  –   Repetitive data
  –   Inconsistent naming convention
  –   Wrong choice of datatypes
  –   No partitioning
Data Issues
• Severe requirement for data standardization?
• Oversized datatypes having incorrect data
  text/bigint)
• Nullable columns
• Unique constraints not present where
  required creating duplicates in master tables
Performance Issues
• Due to oversized columns and row sizes, number
  of rows fitting in a page is less, causing more IO
• Joins requiring more memory
• All sorts goes for temporary file creation on disk
  increasing IO
• Lock (shared / Exclusive) time increase due to
  above reasons, reducing concurrency
• Memory inefficiently used due to oversized rows.
• Every update, needs to update unnecessary
  indexes increasing lock time.
Fixes
1. Reduce the number of rows by creating
  archive db.
2. Remove unwanted indexes and reduce
  insert/update overheads
3. Upgrade to MySQL 5.5
4. Partitioning ?
Short Term fixes at Application tier
• Set isolation level to READ_COMMITTED
• Set dynamic update and dynamic insert = TRUE. 95% of the
  updates update all columns even if few columns are
  modified.
• Review transaction boundaries. Few flows don't close
  (commit/rollback) leaving open transactions
• Query tuning – Not all hibernate queries are optimal. Most
  of them do left outer join even when not required.
• Query tuning – Review queries not using indexes, badly
  formed queries
• Most queries bring all columns (Select *) and usually
  discarded. This is an overhead on cache, n/w and the app.
  Tier session as well.
Long Term Fixes
1.   Schema changes (Normalized, smaller tables)
2.   Partitioning
3.   Sharding (Application aware / Abstract)
4.   Fan- In topology or Cluster
Master – Master Setup
• In order scale writes, this is usually a
  technique that is used. However here are pit
  falls –
  – Management of auto increment columns
  – A violation of a constraint on one of the masters
    can break replication rendering the failed master
    as slave
  – Resyncing of masters is time consuming and error
    prone (replication limitation)

Weitere ähnliche Inhalte

Was ist angesagt?

Dba lounge-sql server-performance-troubleshooting
Dba lounge-sql server-performance-troubleshootingDba lounge-sql server-performance-troubleshooting
Dba lounge-sql server-performance-troubleshooting
Dan Andrei Stefan
 

Was ist angesagt? (8)

Breaking data
Breaking dataBreaking data
Breaking data
 
Stacks and Mathematical Expressions
Stacks and Mathematical ExpressionsStacks and Mathematical Expressions
Stacks and Mathematical Expressions
 
Dba lounge-sql server-performance-troubleshooting
Dba lounge-sql server-performance-troubleshootingDba lounge-sql server-performance-troubleshooting
Dba lounge-sql server-performance-troubleshooting
 
A tale of two sites
A tale of two sitesA tale of two sites
A tale of two sites
 
Hierarchical architecture
Hierarchical architectureHierarchical architecture
Hierarchical architecture
 
Spreadsheet ml subject xml-mapping
Spreadsheet ml subject   xml-mappingSpreadsheet ml subject   xml-mapping
Spreadsheet ml subject xml-mapping
 
How to use data mapper transformer
How to use data mapper transformerHow to use data mapper transformer
How to use data mapper transformer
 
Database administrator project-presentation-1-v1
Database administrator project-presentation-1-v1Database administrator project-presentation-1-v1
Database administrator project-presentation-1-v1
 

Andere mochten auch (7)

Sahu
SahuSahu
Sahu
 
Sa
SaSa
Sa
 
Phphacku iitd
Phphacku iitdPhphacku iitd
Phphacku iitd
 
Next Generation Hadoop: High Availability for YARN
Next Generation Hadoop: High Availability for YARN Next Generation Hadoop: High Availability for YARN
Next Generation Hadoop: High Availability for YARN
 
Sahul
SahulSahul
Sahul
 
Sah
SahSah
Sah
 
Sahul
SahulSahul
Sahul
 

Ähnlich wie My sql performance

Project Presentation Final
Project Presentation FinalProject Presentation Final
Project Presentation Final
Dhritiman Halder
 
Handling Massive Writes
Handling Massive WritesHandling Massive Writes
Handling Massive Writes
Liran Zelkha
 
Kb 40 kevin_klineukug_reading20070717[1]
Kb 40 kevin_klineukug_reading20070717[1]Kb 40 kevin_klineukug_reading20070717[1]
Kb 40 kevin_klineukug_reading20070717[1]
shuwutong
 
Blackboard DevCon 2011 - Developing B2 for Performance and Scalability
Blackboard DevCon 2011 - Developing B2 for Performance and ScalabilityBlackboard DevCon 2011 - Developing B2 for Performance and Scalability
Blackboard DevCon 2011 - Developing B2 for Performance and Scalability
Noriaki Tatsumi
 

Ähnlich wie My sql performance (20)

NoSql
NoSqlNoSql
NoSql
 
SKILLWISE-SSIS DESIGN PATTERN FOR DATA WAREHOUSING
SKILLWISE-SSIS DESIGN PATTERN FOR DATA WAREHOUSINGSKILLWISE-SSIS DESIGN PATTERN FOR DATA WAREHOUSING
SKILLWISE-SSIS DESIGN PATTERN FOR DATA WAREHOUSING
 
Best storage engine for MySQL
Best storage engine for MySQLBest storage engine for MySQL
Best storage engine for MySQL
 
Denormalization
DenormalizationDenormalization
Denormalization
 
Exchange Server 2013 : les mécanismes de haute disponibilité et la redondance...
Exchange Server 2013 : les mécanismes de haute disponibilité et la redondance...Exchange Server 2013 : les mécanismes de haute disponibilité et la redondance...
Exchange Server 2013 : les mécanismes de haute disponibilité et la redondance...
 
Roman Rehak: 24/7 Database Administration + Database Mail Unleashed
Roman Rehak: 24/7 Database Administration + Database Mail UnleashedRoman Rehak: 24/7 Database Administration + Database Mail Unleashed
Roman Rehak: 24/7 Database Administration + Database Mail Unleashed
 
Project Presentation Final
Project Presentation FinalProject Presentation Final
Project Presentation Final
 
Rise of Column Oriented Database
Rise of Column Oriented DatabaseRise of Column Oriented Database
Rise of Column Oriented Database
 
Handling Massive Writes
Handling Massive WritesHandling Massive Writes
Handling Massive Writes
 
Postgres db performance improvements
Postgres db performance improvementsPostgres db performance improvements
Postgres db performance improvements
 
Kb 40 kevin_klineukug_reading20070717[1]
Kb 40 kevin_klineukug_reading20070717[1]Kb 40 kevin_klineukug_reading20070717[1]
Kb 40 kevin_klineukug_reading20070717[1]
 
Scalability Considerations
Scalability ConsiderationsScalability Considerations
Scalability Considerations
 
SQL Server Wait Types Everyone Should Know
SQL Server Wait Types Everyone Should KnowSQL Server Wait Types Everyone Should Know
SQL Server Wait Types Everyone Should Know
 
MySQL Performance Secrets
MySQL Performance SecretsMySQL Performance Secrets
MySQL Performance Secrets
 
Modernizing your database with SQL Server 2019
Modernizing your database with SQL Server 2019Modernizing your database with SQL Server 2019
Modernizing your database with SQL Server 2019
 
Blackboard DevCon 2011 - Developing B2 for Performance and Scalability
Blackboard DevCon 2011 - Developing B2 for Performance and ScalabilityBlackboard DevCon 2011 - Developing B2 for Performance and Scalability
Blackboard DevCon 2011 - Developing B2 for Performance and Scalability
 
Galera Cluster DDL and Schema Upgrades 220217
Galera Cluster DDL and Schema Upgrades 220217Galera Cluster DDL and Schema Upgrades 220217
Galera Cluster DDL and Schema Upgrades 220217
 
MySQL Performance Tuning - GNUnify 2010
MySQL Performance Tuning - GNUnify 2010MySQL Performance Tuning - GNUnify 2010
MySQL Performance Tuning - GNUnify 2010
 
high performance databases
high performance databaseshigh performance databases
high performance databases
 
Scaling with sync_replication using Galera and EC2
Scaling with sync_replication using Galera and EC2Scaling with sync_replication using Galera and EC2
Scaling with sync_replication using Galera and EC2
 

Kürzlich hochgeladen

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Kürzlich hochgeladen (20)

Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
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
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
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
 
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
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 

My sql performance

  • 2. Problems • Overview – Most of the tables de-normalized / 2nd normal form – Way too many indexes – Missing constraints – No subtype relationships – Repetitive data – Inconsistent naming convention – Wrong choice of datatypes – No partitioning
  • 3. Data Issues • Severe requirement for data standardization? • Oversized datatypes having incorrect data text/bigint) • Nullable columns • Unique constraints not present where required creating duplicates in master tables
  • 4. Performance Issues • Due to oversized columns and row sizes, number of rows fitting in a page is less, causing more IO • Joins requiring more memory • All sorts goes for temporary file creation on disk increasing IO • Lock (shared / Exclusive) time increase due to above reasons, reducing concurrency • Memory inefficiently used due to oversized rows. • Every update, needs to update unnecessary indexes increasing lock time.
  • 5. Fixes 1. Reduce the number of rows by creating archive db. 2. Remove unwanted indexes and reduce insert/update overheads 3. Upgrade to MySQL 5.5 4. Partitioning ?
  • 6. Short Term fixes at Application tier • Set isolation level to READ_COMMITTED • Set dynamic update and dynamic insert = TRUE. 95% of the updates update all columns even if few columns are modified. • Review transaction boundaries. Few flows don't close (commit/rollback) leaving open transactions • Query tuning – Not all hibernate queries are optimal. Most of them do left outer join even when not required. • Query tuning – Review queries not using indexes, badly formed queries • Most queries bring all columns (Select *) and usually discarded. This is an overhead on cache, n/w and the app. Tier session as well.
  • 7. Long Term Fixes 1. Schema changes (Normalized, smaller tables) 2. Partitioning 3. Sharding (Application aware / Abstract) 4. Fan- In topology or Cluster
  • 8. Master – Master Setup • In order scale writes, this is usually a technique that is used. However here are pit falls – – Management of auto increment columns – A violation of a constraint on one of the masters can break replication rendering the failed master as slave – Resyncing of masters is time consuming and error prone (replication limitation)