• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Mysql Optimization
 

Mysql Optimization

on

  • 1,806 views

 

Statistics

Views

Total Views
1,806
Views on SlideShare
1,798
Embed Views
8

Actions

Likes
1
Downloads
74
Comments
0

1 Embed 8

http://www.linkedin.com 8

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 Mysql Optimization Presentation Transcript

    • MySQL Optimizations Title
    • MySQL Internals
      • MyISAM
      • InnoDB
      • MemoryDB
      • Indexes
      • Ordering
    • MyISAM
      • MyISAM has no clustered index
      • Data ordered by insertion order
    • InnoDB
      • Clustered index for every table
      • rows are physically ordered by the primary key
      • Indexes are B-trees.
      • Primary key’s leaf nodes are the data .
      • there can be page splits
      • InnoDB uses the values from the primary key as its secondary index’s leaf nodes
      • secondary index lookups are more expensive than primary key lookups,
      • Covering index, Using Index
    • InnoDB
    • MemoryDB
      • Fixed length
      • No blob, clob, text
    • Indexes
      • Covering indexes - Query can be executed using only data from the index without reading the row itself
      • Clustered Indexes (Primary) - Table data is physically stored in the order of the keys on the index
      • Non-Clustered Index (Secondary)-
        • The data rows of the underlying table are not sorted and stored in order based on their nonclustered keys.
        • The leaf layer of a nonclustered index is made up of index pages instead of data pages.
      • Index Selectivity- more than 20-25% is bad
      • Index Cardinality
        • RATIO of number of 'distinct' entries for the index against the total number of records in the table
        • Full table scan takes constant time no matter the cardinality, index traversing speed depends on the index cardinality
    • OrderBy – How to
      • 3 Methods
      • Index access on an Ordered Index
      • FileSorting the table and then join
      • Join results to a temporary table and then do FileSort
      • FileSorting – 2 methods
          • the sorted elements contain all required columns of the source table
          • sort pairs and produce a sequence of rowids
          • max_length_of_sort_data
    • OrderBy – How to
    • OrderBy – How to
    • OrderBy – How to
    • Query Optimization
      • Using Explain
      • Show table status
      • Show InnoDB status
      • Show index from table
    • MySQl Server Optimization
      • Data partitioning
      • De-Normalize
      • Use of indexes
      • Server Tuning
    • Server Variables
      • read_buffer_size
      • read_rnd_buffer_size
      • sort_buffer_size
      • myisam_sort_buffer_size
      • tmp_table_size
      • max_heap_table_size
      • key_buffer_size
      • innodb_buffer_pool_size
      • innodb_file_io_threads
      • bulk_insert_buffer_size
      • table_cache
      • open_files_limit
      • thread_cache_size
      • innodb_flush_log_at_trx_commit
      • low-priority-updates
      • max_tmp_table
      • log-slow-queries
      • long_query_time
      • join_buffer_size
    • How Much Buffer Size
      • More is not always good
      • Random I/O
      • Mmap, malloc
      • Fragmentaion
      • Test
    • Show Status
      • Bytes_received
      • Bytes_sent
      • Com_insert
      • Com_select
      • Connections
      • Created_tmp_disk_tables
      • Created_tmp_files
      • Created_tmp_tables
      • Handler_read_next
      • Opened_tables
      • Qcache_hits
      • Questions
      • Select_full_join
      • Select_scan
      • Select_range
      • Slow_queries
      • Sort_merge_passes
      • Sort_rows
      • Sort_scan
      • Table_locks_waited
      • Threads_cached
      • Threads_created
    • Tools
      • mysqlreport - MySQL stat report
      • mysqlsla - MySQL slow log analyser
      • innotop - InnoDB monitor
      • Mtop
      • MaatKit
      • Query analyzer