• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
MySQL Optimization from a Developer's point of view
 

MySQL Optimization from a Developer's point of view

on

  • 1,468 views

Optimization from a developer's point of view. Optimization is not only the duty of a DBA but its should be done by all those who are involved in the ecosystem

Optimization from a developer's point of view. Optimization is not only the duty of a DBA but its should be done by all those who are involved in the ecosystem

Statistics

Views

Total Views
1,468
Views on SlideShare
1,439
Embed Views
29

Actions

Likes
0
Downloads
0
Comments
0

2 Embeds 29

http://www.digimantra.com 28
http://127.0.0.1 1

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    MySQL Optimization from a Developer's point of view MySQL Optimization from a Developer's point of view Presentation Transcript

    • MySQL Optimization Tips to increase performanceSachin KhoslaFounder, Digimantra.com
    • What’s next ? MySQL – What’s that ? Optimize ? Where and What ? Quick Glance at the famous MySQL Storage Engines Many ways but we talk about Cache systems  Query Cache  File Cache  MemCached  Solr/Lucene
    • Let’s Go !Have a question ? • If it’s a short – Shoot it ? • If it’s a long – Save it till end of the session :)
    • As many of you know !•MySQL is a relational database•Community Edition is free of cost•Free GUI tools for Server Administration•Support by the community, forums, manual/docs etc.
    • Why Optimize• Cost • Tuned system = less resources = less investment. • After tuning the system, you get a real usage stat.• Performance • Performance of the system increases the output :) • Happy developers = Happy end users• Stay in the game • Undoubtedly you want to keep pace with the latest technology • Faster systems showcase helps bring in more business
    • Who Should Optimize?Ecosystem – Who are responsible in developing that very application. 1. Designers – The documenting guys :) 2. Developers – Geeks :D 3. System/DB Administrators – The machines :P
    • Optimized, Really ?• Benchmarking• Profiling• Difference between the Benchmark & ProfilingRef - http://dev.mysql.com/tech-resources/articles/pro-mysql-ch6.html
    • MySQL flavors•MyISAM – The ideal son•InnoDB – Clever but expensive*•Memory (Heap)
    • MyISAM InnoDB•Of course, there is no •Of course, there is nodifference. It’s just you ! difference. It’s just you !•You need speed and term •You understand, what“transaction” is martian for transactions are and how areyou. they going to effect.•You sure about the size of •Sky is the limit – did youthe data in your database. smell cloud computing,eh?•Data is stored in insertion •Rows are physically orderedorder. (no clustered index) by the primary key
    • Memory (Heap)• Faster, Performance booster• Intermediary table• Use it when you have more select than insert• Table Structure remains not the data• Fixed length for data types like varchar• No support for text, blob
    • Finally, ways to boost performance• Mysql Query Cache• File Cache system• Memcached• Solr / Lucene
    • Mysql Query Cache• Internal cache system of MySQL• Caches the queries being fired• Never returns stale data• Good when you have less or almost no inserts• Be sure to choose an optimum size for cache (query_cache_size)
    • File Cache system• Traditional way of caching with files.• Saves database server ping.• Still accesses the file structure.• No Big Deal !
    • Memcached• How is it different than traditional cache ?• Can it improve my site’s application’s performance ?• How ? $mem = new Memcache(); //PECL extn in PHP $mem->connect(‘SERVER_NAME’,’PORT_NO’); //connect $mem->set(‘key’,’data’); //set memcached KV pair $mem->get(‘key’); //get data
    • Solr / Lucene•Hit highlighting, faceted search, caching, replication,and a web administration interface – Heavy terms ?•In simple terms it’s a server which has indexes of thedatabase and when you send a request to it, it returnyou data in the form of XML/JSON
    • Other ways• Query Optimization • Using Explain • Show table status (InnoDB / MySQL) • Show InnoDB status (indexes and all )•Table level Optimization • Normalization• DB Server Level • mysqld status • Process monitoring tools
    • Q&A
    • Thank you ! www.digimantra.com Twitter - @realinFB – http://fb.me/sachinkhosla