MySQL Breakfast in London - 24 June 2010

103
MySQL Breakfast London, 24 June 2010 Friday, 25 June 2010

description

These are the slides presented at the MySQL Breakfast in London on June 24 2010

Transcript of MySQL Breakfast in London - 24 June 2010

<Insert Picture Here>

MySQL BreakfastLondon, 24 June 2010

Friday, 25 June 2010

<Insert Picture Here>

Agenda

9 am Welcome Coffee and Tea

9.30 am Oracle’s MySQL Strategy and Positioning

10 am What’s new with MySQL Server 5.5

MySQL Cluster 7.1

10.45 am Coffee and Tea Break

11 am MySQL Enterprise 2.2

MySQL Workbench 5.2

11.45 am Q&A

Friday, 25 June 2010

<Insert Picture Here>

Strategy & Positioning Rich MasonVice President

Friday, 25 June 2010

Oracle’s Strategy:Complete. Open. Integrated.

•Built together•Tested together•Managed together•Serviced together•Based on open standards•Lower cost•Lower risk•More reliable

Friday, 25 June 2010

Oracle’s Investment in Open Source

• Supported popular open source projects for many years• Part of Oracle’s Complete, Open, Integrated strategy• Speed up time-to-innovation• Expand the developer community

Friday, 25 June 2010

Complete. Open. Integrated. Two more important attributes

•Oracle never settles for being second best at any level of the stack

• “Complete” means we meet most customer requirements at every level

That’s why MySQL matters to Oracle and Oracle customers

Friday, 25 June 2010

Industry’s most complete LAMP Stack

• Oracle Enterprise Linux

• Oracle VM (Xen-based)

• Apache, Glassfish

• MySQL

• PHP, Perl, Python, Ruby, Java, C, C++

Oracle Enterprise Linux& Oracle VM

MySQL

ApacheGlassfish

Applications

EclipseNetbeans

Friday, 25 June 2010

Investment in MySQL

•Make MySQL a Better MySQL• #1 Open Source Database for Web Applications

•Develop, Promote and Support MySQL• Improve engineering, consulting and support• Leverage 24x7, World-Class Oracle Support

•MySQL Community Edition • Source and binary releases• GPL license

Friday, 25 June 2010

Investment in MySQL

•MySQL Focus Areas• Web, Embedded & Telecom• LAMP• Windows

•Oracle + MySQL Customers• Oracle Enterprise Manager• Oracle Secure Backup• Oracle Audit Vault

Friday, 25 June 2010

Making MySQL Better TodayMySQL 5.5

MySQL Cluster 7.1 MySQL Workbench 5.2

MySQL Enterprise Monitor 2.2

Products

Friday, 25 June 2010

• September 19-23, 2010• San Francisco, CA

• Over 2,100 sessions• Includes a MySQL track• 3 Exhibition Halls• For more information:

• Oracle OpenWorld: oracle.com/openworld• JavaOne + Develop: oracle.com/javaonedevelop

Oracle OpenWorld and JavaOne + Develop Conferences

Friday, 25 June 2010

Key Takeaways

•MySQL is important to Oracle and our customers• Part of our Complete, Open, Integrated strategy

•Oracle is making MySQL better today• Major Feature, Performance, Scalability enhancements• 24x7, Global support in 145 countries

Download Now

http://dev.mysql.com/downloads

Friday, 25 June 2010

Friday, 25 June 2010

<Insert Picture Here>

What’s New with MySQL Server 5.5Ivan ZorattiSales Consulting Manager EMEA

1006.01Friday, 25 June 2010

The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions.The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle.

Friday, 25 June 2010

<Insert Picture Here>

Agenda

• Intro to MySQL 5.5 Server•Replication with MySQL 5.5• InnoDB 1.1 for MySQL 5.5•MySQL 5.5 Usability

Friday, 25 June 2010

<Insert Picture Here>

MySQL 5.5 Server

Friday, 25 June 2010

Pluggable Storage Engine Architecture

Friday, 25 June 2010

MySQL 5Reliability

• SQL Mode• Triggers & Views• Precision Math• Increased object support• Enteprise Monitoring Tool

• Row-Based Replication• Disk-based Cluster• Cluster Replication with

Conflict Resolution• Enterprise Query Analyser

• Default InnoDB (Barracuda)• Semi-Sync Replication• Enterprise Connectors• Enterprise Support

Diagnostics• MySQL Cluster on Windows• Fast InnoDB Recovery

Ease of Use

• Instance Manager • Information Schema• Cursors• Enterprise Backup & Recovery

Manager

• XML/XPath Support• Task Scheduler• Storage Engine Plug-in API• CSV Storage Engine

•SIGNAL/RESIGNAL• NDB_INFO Schema• MySQL Cluster Manager• MySQL Workbench 5.2• MySQL Cluster Connectors• MySQL Enterprise Backup

Performance

• Stored Procedures• Cluster query push down• Query optimisations• Archive Engine• InnoDB storage improvements

• Table/Index Partitioning• Full-Text Index Improvements• Faster ALTER TABLE• Faster ADD/DROP Index• Parallel Data Import

• Multiple Buffer Pool and Rollback Segment

• Eliminated Lock bottlenecks• Extended Change Buffering &

Purge Scheduling•PERFORMANCE_SCHEMA• Multithreaded Cluster

5.0

5.1

5.5β

Friday, 25 June 2010

Improved Performance and Scalability• InnoDB becomes default storage engine• Better metadata locking within transactions• Improved performance and scalability on Windows• InnoDB Improvements

Improved Availability• Semi-synchronous Replication• Replication Heartbeat

Improved Usability• SIGNAL/RESIGNAL• More Partitioning Options• PERFORMANCE_SCHEMA

MySQL 5.5 at a glanceBeta

http://dev.mysql.com/tech-resources/articles/introduction-to-mysql-55.htmlFriday, 25 June 2010

Performance Improvements• Improved recovery performance• Multiple buffer pool instances• Multiple rollback segments• Native asynchronous I/O for Linux• Extended change buffering

Scalability Improvements• Improved Log Sys Mutex• Separate Flush List Mutex• Improved purge scheduling

Better Instrumentation and Diagnostics• InnoDB stats in PERFORMANCE_SCHEMA

InnoDB 1.1 for MySQL 5.5at a glance Beta

http://dev.mysql.com/tech-resources/articles/introduction-to-mysql-55.htmlFriday, 25 June 2010

Replication withMySQL 5.5

Friday, 25 June 2010

MySQL Replication• Achieve higher availability with a master/slave setup• In the event of problems with the master, you can switch to the slave as a

backup• Available for all platforms• Enabled for all storage engines• Asynchronous or Semi-Synchronous with Heartbeat• Statement Based (SBR), Row Based (RBR) or mixed-format (MIXED)• Replicate data from one MySQL server/storage engine combination to a

different MySQL Server/storage engine combination• Perform backups using a slave server and continue to process updates on the

master while the backup is being made on the slave• Extremely simple configuration to enable very robust replication• Multiple replication topologies supported

Application Slave Master

http://www.mysql.com/why-mysql/white-papers/mysql_ha_solutions.phpFriday, 25 June 2010

MySQL Replication

• Data written on the master is also written into the binary log

• The I/O thread on the slave collects logs from the master binary log and writes a relay log on the slave

• The SQL thread on the slave reads the relay log and apply the writes on the slave

• Slave writes are optionally added to the binary log on the slave

Friday, 25 June 2010

Replication with MySQL 5.5

• Semi-Synchronous Replication• Improves the reliability of failover• COMMITs on the Master node are acknowledged only when at

least one of the Slave nodes has logged the event• Data is not lost in case of failover

• Replication Heartbeat• Avoids spurious relay log rotation when the Master node is idle• Replication delay is more accurate

• Reliability and Administration• Slave fsync tuning• Automatic Relay Log recovery• SHOW RELAYLOG EVENTS• Per server replication filtering

Friday, 25 June 2010

Semi-synchronous Replication• A Slave indicates whether it is semisync-capable when it connects to the Master.• There must be at least one semisync Slave on.• The COMMIT on the Master waits until at least one semisync Slave acknowledges that it

has received the transaction, or until a timeout occurs.• The Slave acknowledges a transaction only after it has been written to its relay log and

flushed to disk.• If a timeout occurs, the Master reverts to async replication. When at least one semisync

Slave catches up, the Master returns to semisync replication.• Semisync replication must be enabled on both the Master and Slave sides.

On Master and Slave:have_dynamic_loading=YES

On the Master:INSTALL PLUGIN rpl_semi_sync_master SONAME 'semisync_master.so';SET GLOBAL rpl_semi_sync_master_enabled = 1;SET GLOBAL rpl_semi_sync_master_timeout = N;

On the Slave:INSTALL PLUGIN rpl_semi_sync_slave SONAME 'semisync_slave.so';SET GLOBAL rpl_semi_sync_master_enabled = 1;STOP SLAVE IO_THREAD; START SLAVE IO_THREAD;

Friday, 25 June 2010

Semi-sync Option and System Variables

Name System/Status Dyn Description

init_slave SYS ✔ Executed by a Slave when the SQL thread startsrpl_semi_sync_master_clients STA # of semi-sync slavesrpl_semi_sync_master_enabled SYS ✔ Enable semi-sync replication on the Masterrpl_semi_sync_master_net_avg_wait_time STA Avg a Master waited for a Slave to replyrpl_semi_sync_master_net_wait_time STA Tot a Master waited for a Slave to replyrpl_semi_sync_master_net_waits STA # of times a Master waited for a Slave to replyrpl_semi_sync_master_no_times STA # of times a Master turned off semi-sync replicationrpl_semi_sync_master_no_tx STA # of COMMITs that were not acknowledged successfully by a Slaverpl_semi_sync_master_status STA Whether semi-sync replication currently is operational on the Masterrpl_semi_sync_master_timefunc_failures STA The number of times the Master failed when calling time functionsrpl_semi_sync_master_timeout SYS ✔ # of sec the Master waits before reverting to asyncrpl_semi_sync_master_trace_level SYS ✔ Debug trace level - 1/16/32/64rpl_semi_sync_master_tx_avg_wait_time STA Avg time the Master waited for each transactionrpl_semi_sync_master_tx_wait_time STA Tot time the Master waited for each transactionrpl_semi_sync_master_tx_waits STA # of times the Master waited for transactionsrpl_semi_sync_master_wait_no_slave SYS ✔ ON/OFF - Always wait for the timeout to expire to revert to ayncrpl_semi_sync_master_wait_pos_backtraverse STA # of times the Master waited for events with lower coordinatesrpl_semi_sync_master_wait_sessions STA # of sessions waiting for Slave repliedrpl_semi_sync_master_yes_tx STA # of successful COMMITs on a Slaverpl_semi_sync_slave_enabled SYS ✔ Enable semi-sync replication on the Slaverpl_semi_sync_slave_status STA Whether semi-sync replication currently is operational on the Slaverpl_semi_sync_slave_trace_level SYS ✔ Debug trace level - 1/16/32/64

Friday, 25 June 2010

Replication Heartbeat

• Sets an heartbeat between Master and Slave nodes to control replication operations

• Prior to MySQL 5.5:• Relay logs were rotated every slave_net_timeout even when

no statements were replicated• SHOW SLAVE STATUS showed an incorrect seconds_behind_master after a FLUSH LOGS

On Master and Slave:have_dynamic_loading=YES

On the Master:CHANGE MASTER TO master_heartbeat_period = <milliseconds>;

On the Slave:SHOW STATUS like 'slave_heartbeat period'SHOW STATUS like 'slave_received_heartbeats'

Friday, 25 June 2010

Replication reliability

• Safe logging of mixed transactions• Each thread has 2 caches: a

statement cache and a transaction cache

• InnoDB and MyISAM changes are correctly serialised in RBR and MIXED

• binlog_direct_non_transactional_updates are written directly to the Binary Log instead of the transaction cache in SBR MyISAM InnoDB BinLog

TXNCache

StmtCache

Friday, 25 June 2010

Slave reliability• sync_master_info

• N (N > 0): A Slave node syncs its master.info file to disk (using fdatasync()) after N transactions

• sync_relay_log• 0: The operating system is responsible to sync the Relay Log• 1: The Slave node syncs its Relay Log to disk (using fdatasync()) after every transaction

• sync_relay_log_info• N (N > 0): A Slave node syncs its relay-log.info file to disk

(using fdatasync()) after every N transactions• relay_log_recovery

• 1: Enables automatic Relay Log recovery immediately following server startup. The Slave node discards all unprocessed relay logs and retrieves them from the Master node

Friday, 25 June 2010

Replication Administration

• SHOW RELAY LOG EVENTS IN ‘<relaylogfile>’• Shows events in the Relay Log

• CHANGE MASTER TO IGNORE_SERVER_IDS = (...);• Does not replicate events with the specified Server ID

• SLAVE_TYPE_CONVERSION = (ALL_LOSSY, ALL_NON_LOSSY)• Enable conversions of datatypes between Master and Slave

nodes in RBR• Allowed ALL_LOSSY: INT > TINYINT, not TINYINT > INT

• If no conversion is set, columns on Master and Slave nodes must have the same datatype

• FLUSH <LogType> LOGS• SLOW, ERROR, BINARY, ENGINE, GENERAL, RELAY

Friday, 25 June 2010

MySQL Replication and Linux Heartbeat

Applications

Replication

Virtual IPMaster Semisync Slave

Semisync Replication

Scale-out Slave Scale-out Slave Scale-out Slave

Friday, 25 June 2010

<Insert Picture Here>

InnoDB 1.1 forMySQL 5.5

Friday, 25 June 2010

InnoDB Plugin 1.0• Available GA with MySQL 5.1• Data compression with the Barracuda file format• Backward compatibility with previous InnoDB features• Improvements

• Performance, Scalability, Throughput• Thread/Concurrency management• OS memory allocators• Adaptive Hash Indexing and Insert Buffer• Faster locking• GROUP COMMIT

• Manageability and Efficiency• Faster ADD/DROP INDEX• New storage options for large objects and variable lengths datatypes

• Uptime and Availability• Dynamic control of configuration variables• InnoDB strict mode• Control of optimizer statistics estimation

http://www.innodb.com/doc/innodb_plugin-1.0/Friday, 25 June 2010

InnoDB Crash Recovery

• Improved algorithm for memory management• Faster redo log scan and redo log apply• Available in InnoDB Plugin 1.0.7 and 1.1• Phases:

1.Redo Log scan2.Redo Log application

• Change from linear search to binary search of n operations from n*n to n*log n

3.Rollback of uncommitted transactions• Standard sysbench recovery improved from 7 hours to 14 minutes

http://dev.mysql.com/doc/innodb-plugin/1.1/en/innodb-performance-recovery.htmlFriday, 25 June 2010

Multiple Buffer Pool

• Prior to InnoDB 1.1: All threads had to acquire exclusive access to a single buffer pool• ca 700k/sec, held 50% of the time

• Minimise contention by assigning DB pages randomly to one of the buffer pools

• For each buffer pool there are Free list, Flush list, LRUs Page Hash Table and other data structures and a buffer pool mutex

• The Flush List is also split from the buffer pool mutex• innodb_buffer_pool_instances=N

• 1 <= N <= 64• Only when innodb_buffer_pool_size >= 1GB (total pool)

http://dev.mysql.com/doc/innodb-plugin/1.1/en/innodb-multiple-buffer-pools.htmlFriday, 25 June 2010

Multiple Buffer Pool - Results

• sysbench RW on 16 cores shows 10% improvement• Large improvement on more cores

Friday, 25 June 2010

Multiple Rollback Segments

• Prior to InnoDB 1.1: A Rollback Segment can handle up to 1023 concurrent “write” transactions• ca 20k/sec, held ca 25% of the time

• InnoDB 1.1: the Rollback segment is divided into 128 segments. Each segment supports 1024 concurrent W transactions, i.e. 128k concurrent W transactions

• Transactions are associated to a segment using a hashing function

• Significant improvement with 32+ cores

• Execute a slow shutdown (SET GLOBAL innodb_fast_shutdown=0) and a restart to enable the Multiple Rollback Segments

http://dev.mysql.com/doc/innodb-plugin/1.1/en/innodb-multiple-rollback-segments.htmlFriday, 25 June 2010

Native Asynchronous I/O

• Prior to InnoDB 1.1: asynchronous I/O was supported on Windows systems only• On Linux systems the query thread blocked until the request

finished• True synchronous I/O support on Linux• innodb_use_native_aio=[0|1]

• Set to 1 by default, it can be set to 0 if the Operating System prevents InnoDB from starting

• Apply to Linux systems only

http://dev.mysql.com/doc/innodb-plugin/1.1/en/innodb-performance-aio-linux.htmlFriday, 25 June 2010

Extended Change Buffering

• Controls the flush to disk of secondary indexes when data is available in the buffer pool

• Buffers deletes and purges and perform those in background

• Delete-only benchmark may increase from 50 del/sec to 8000 del/sec

• innodb_change_buffering =[all|none|inserts|deletes|changes|purges]

http://dev.mysql.com/doc/innodb-plugin/1.1/en/innodb-performance-change_buffering.htmlFriday, 25 June 2010

log_sys and others mutex

• Prior to InnoDB 1.1: the log_sys mutex was responsible for the protection of different memory areas• ca 350k/sec, held ca 75% of the time

• InnoDB 1.1: the mutex is split in log_sys and log_flush_order• ca 5% performance increase

• LOCK_alarm has been removed - ca 2% performance increase

• LOCK_open has been modified, removing hash calculation and splitting the old mutex in more mutexes (new MDL - MetaData Locking)

• LOCK_thread_count has been removed in several places

http://dev.mysql.com/doc/innodb-plugin/1.1/en/innodb-improved-log-sys-mutex.htmlFriday, 25 June 2010

Other Improvements• Adaptive Hash Indexing

• Automatically creates in-memory hash tables from B-tree index keys• innodb_adaptive_hash_index=[ON|OFF]

• Thread Concurrency• innodb_thread_concurrency = 0• innodb_thread_sleep_delay = 10000 (microsec)• innodb_concurrency_tickets = 500

• Multiple Background I/O Threads• The # of read and write I/O threads can be configured• Each thread handles up to 256 pending I/O requests• innodb_read_io_threads = 4• innodb_write_io_threads = 4

• Group Commit reintroduced• Master Thread I/O Rate

• Controls the number of background I/O operations• innodb_io_capacity = 200

• Spin Lock Polling• innodb_spin_wait_delay=6 (microsec)• Controls the polling of mutexes and rw-locks• May be set to 0 for fast CPU servers

Friday, 25 June 2010

InnoDB Stats

• InnoDB statistics are part of the PERFORMANCE_SCHEMA• Special tables:

• MUTEX_INSTANCES• RWLOCK_INSTANCES• FILE_INSTANCES• FILE_SUMMARY_BY_EVENT_NAME• FILE_SUMMARY_BY_INSTANCE• EVENTS_WAITS_CURRENT• EVENTS_WAIT_HISTORY_LONG

Friday, 25 June 2010

MySQL 5.5 SysBench Benchmarks

Intel Xeon X7460 x86_64 4 CPU x 6 Cores/CPU 2.66 GHz, 32GB RAM Fedora 10

MySQL 5.1.40(InnoDB built-in)

MySQL 5.1.40 (InnoDB Plug-in)

MySQL 5.5.4 (New InnoDB)

200% performance gainfor MySQL 5.5 over 5.1.40; at scale

Friday, 25 June 2010

MySQL 5.5 SysBench Benchmarks

MySQL 5.1.40(InnoDB built-in)

MySQL 5.1.40 (InnoDB Plug-in)

MySQL 5.5.4 (New InnoDB)

Intel Xeon X7460 x86_64 4 CPU x 6 Cores/CPU 2.66 GHz, 32GB RAM Fedora 10

364% performance gain

for MySQL 5.5 over 5.1.40; at scale

Friday, 25 June 2010

What Facebook is saying

I previously tested InnoDB on an 8-core server to determine how many IOPs it can do for a simple IO-bound workload. The limits were ~12k disk reads/second for MySQL 5.0 and ~18k reads/second for MySQL 5.1. I just repeated the tests using a 16-core server and the results are much better. I can get 20,000 to 30,000 disk reads/second using InnoDB 5.1. InnoDB 5.5 appears to be capable of 50,000 to 70,000 disk reads/second courtesy of support for multiple buffer pools (innodb_buffer_pool_instances).Mark Callaghan’s Blog, Facebook - 21 June 2010

http://www.facebook.com/note.php?note_id=403975340932Friday, 25 June 2010

What Facebook is saying

http://www.facebook.com/note.php?note_id=403975340932Friday, 25 June 2010

MySQL 5.5 Usability

Friday, 25 June 2010

SIGNAL/RESIGNAL

• Allow error handling in stored routines

• The execution is passed to an error handler

• Accessible error values are SQLSTATE, MESSAGE_TEXT and MYSQL_ERRNO

• RESIGNAL can pass along the original or a new information

CREATE PROCEDURE p (pval INT)BEGIN DECLARE specialty CONDITION FOR SQLSTATE '45000'; IF pval = 0 THEN SIGNAL SQLSTATE '01000'; ELSEIF pval = 1 THEN SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'An error occurred'; ELSEIF pval = 2 THEN SIGNAL specialty SET MESSAGE_TEXT = 'An error occurred'; ELSE SIGNAL SQLSTATE '01000' SET MESSAGE_TEXT = 'A warning occurred', MYSQL_ERRNO = 1000; SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'An error occurred', MYSQL_ERRNO = 1001; END IF;END;

DROP TABLE IF EXISTS xx;CREATE PROCEDURE p ()BEGIN DECLARE EXIT HANDLER FOR SQLEXCEPTION BEGIN SET @error_count = @error_count + 1; IF @a = 0 THEN RESIGNAL SQLSTATE '45000' SET MYSQL_ERRNO=5; END IF; END; DROP TABLE xx;END;

SET @error_count = 0; SET @a = 0; SET @@max_error_count = 2;CALL p();SHOW ERRORS;

Friday, 25 June 2010

MySQL 5.5 Performance Schema

• PERFORMANCE_SCHEMA presents low level MySQL performance information

• Data can be cleared• Filters with WHERE are allowed

• Must be enabled with --performance_schema

mysql> SELECT EVENT_ID, EVENT_NAME, TIMER_WAIT -> FROM EVENTS_WAITS_HISTORY WHERE THREAD_ID = 13 -> ORDER BY EVENT_ID;+----------+-----------------------------------------+------------+| EVENT_ID | EVENT_NAME | TIMER_WAIT |+----------+-----------------------------------------+------------+| 86 | wait/synch/mutex/mysys/THR_LOCK::mutex | 686322 || 87 | wait/synch/mutex/mysys/THR_LOCK_malloc | 320535 || 88 | wait/synch/mutex/mysys/THR_LOCK_malloc | 339390 || 89 | wait/synch/mutex/mysys/THR_LOCK_malloc | 377100 || 90 | wait/synch/mutex/sql/LOCK_plugin | 614673 || 91 | wait/synch/mutex/sql/LOCK_open | 659925 || 92 | wait/synch/mutex/sql/THD::LOCK_thd_data | 494001 || 93 | wait/synch/mutex/mysys/THR_LOCK_malloc | 222489 || 94 | wait/synch/mutex/mysys/THR_LOCK_malloc | 214947 || 95 | wait/synch/mutex/mysys/LOCK_alarm | 312993 |+----------+-----------------------------------------+------------+

mysql> UPDATE SETUP_INSTRUMENTS -> SET ENABLED = 'NO' -> WHERE NAME = 'wait/synch/mutex/myisammrg/MYRG_INFO::mutex';

mysql> UPDATE SETUP_CONSUMERS -> SET ENABLED = 'NO' WHERE NAME = 'file_summary_by_instance';

Friday, 25 June 2010

MySQL 5.5 Partitioning

• New RANGE COLUMNS and LIST COLUMNS added to the CREATE TABLE statement

• Single or multiple column names can be used instead of expressions

• Range and list partitions can be based in integers, DATE, DATETIME, CHAR or VARCHAR

CREATE TABLE expenses ( expense_date DATE NOT NULL, category VARCHAR(30), amount DECIMAL (10,3) );

ALTER TABLE expenses PARTITION BY LIST COLUMNS (category) ( PARTITION p01 VALUES IN ( 'lodging', 'food'), PARTITION p02 VALUES IN ( 'flights', 'ground transportation'), PARTITION p03 VALUES IN ( 'leisure', 'customer entertainment'), PARTITION p04 VALUES IN ( 'communications'), PARTITION p05 VALUES IN ( 'fees'));

CREATE TABLE employees ( emp_no int(11) NOT NULL, birth_date date NOT NULL, first_name varchar(14) NOT NULL, last_name varchar(16) NOT NULL, gender char(1) DEFAULT NULL, hire_date date NOT NULL ) ENGINE=MyISAM PARTITION BY RANGE COLUMNS(gender,hire_date) (PARTITION p01 VALUES LESS THAN ('F','1990-01-01'), PARTITION p02 VALUES LESS THAN ('F','2000-01-01'), PARTITION p03 VALUES LESS THAN ('F',MAXVALUE), PARTITION p04 VALUES LESS THAN ('M','1990-01-01'), PARTITION p05 VALUES LESS THAN ('M','2000-01-01'), PARTITION p06 VALUES LESS THAN ('M',MAXVALUE), PARTITION p07 VALUES LESS THAN (MAXVALUE,MAXVALUE)

Friday, 25 June 2010

Thank You

• Documentation: http://dev.mysql.com/doc• Blogs: http://planet.mysql.com• Forums: http://forums.mysql.com

[email protected] - [email protected]://izoratti.blogspot.com

Download Now

http://dev.mysql.com/downloads

Friday, 25 June 2010

Friday, 25 June 2010

<Insert Picture Here>

MySQL Cluster 7.1Andrew MorganSenior Product Manager, MySQL Cluster

1006.01Friday, 25 June 2010

The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions.The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle.

Friday, 25 June 2010

MySQL Cluster Mgmt

Clients

MySQL Cluster Data Nodes

MySQL Cluster Application Nodes

MySQL Cluster Mgmt

MySQL Cluster

Friday, 25 June 2010

Leading Open-Source, Carrier Grade Real Time Database

• Network Subscriber Databases• Service Delivery Platforms

• Messaging• Presence

• VoIP Infrastructure• Intelligent Networks• Value Added Services• IPTV• Mobile Content Delivery• Gaming• DNS/DHCP for Broadband• Payment Gateways

Friday, 25 June 2010

MySQL Cluster 7.1 – Key Enhancements

• Simplified Management & Monitoring:• ndbinfo real-time monitoring• MySQL Cluster Manager

• Faster system restarts

Reducing Cost of Operations

• MySQL Cluster Connector for Java:• Native Java API• OpenJPA Plug-In

Delivering up to 10x higher Java Throughput

• GA Version - Ready for production

Windows Support

http://www.mysql.com/why-mysql/white-papers/mysql_wp_cluster7_architecture.phpFriday, 25 June 2010

MySQL Cluster 7.1: ndbinfo

• New database (ndbinfo) which presents real-time metric data in the form of tables

• Exposes new information together with providing a simpler, more consistent way to access existing data

• Examples include:• Resource usage (memory, buffers)• Event counters (such as number of READ

operations since last restart)• Data node status and connection status

mysql> use ndbinfomysql> show tables;+-------------------+| Tables_in_ndbinfo |+-------------------+| blocks || config_params || counters || logbuffers || logspaces || memoryusage || nodes || resources || transporters |+-------------------+

http://www.mysql.com/why-mysql/white-papers/mysql_wp_cluster7_architecture.phpFriday, 25 June 2010

• Example 1: Check memory usage/availability

• Note that there is a DATA_MEMORY and INDEX_MEMORY row for each data node in the cluster

• If the Cluster is nearing the configured limit then increase the DataMemory and/or IndexMemory parameters in config.ini and then perform a rolling restart

MySQL Cluster 7.1: ndbinfo

http://www.mysql.com/why-mysql/white-papers/mysql_wp_cluster7_architecture.php

mysql> select * from ndbinfo.memoryusage;+---------+--------------+--------+------------+-----------+-------------+| node_id | memory_type | used | used_pages | total | total_pages |+---------+--------------+--------+------------+-----------+-------------+| 3 | Data memory | 917504 | 28 | 104857600 | 3200 || 3 | Index memory | 221184 | 27 | 11010048 | 1344 || 4 | Data memory | 917504 | 28 | 104857600 | 3200 || 4 | Index memory | 221184 | 27 | 11010048 | 1344 |+---------+--------------+--------+------------+-----------+-------------+

Friday, 25 June 2010

MySQL Cluster 7.1: ClusterJ/JPA Plugin• Traditionally, Java applications have

accessed MySQL Cluster in one of two ways:• JDBC Driver for MySQL (Connector/J) via

MySQL Server• Written own JNI layer on top of NDB API

• New Domain Object Model Persistence API (ClusterJ) :• Java API• High performance, low latency• Feature rich

• JPA interface built upon this new Java layer:• Java Persistence API compliant

• Implemented as an OpenJPA plugin• Uses ClusterJ where possible, reverts to JDBC

for some operations• Higher performance than JDBC• More natural for most Java designers• Easier Cluster adoption for web applications

Data Nodes

Network

AppsApps Apps

OpenJPAClusterJPA

Apps

JDBC ClusterJ

Apps

MySQL JNI JNINDB API (C++)

http://www.mysql.com/why-mysql/white-papers/mysql_wp_cluster_connector_for_java.phpFriday, 25 June 2010

Java Access Performance

http://www.mysql.com/why-mysql/white-papers/mysql_wp_cluster_connector_for_java.phpFriday, 25 June 2010

MySQL Cluster Manager 1.0 Features

Delivered as part of MySQL Cluster CGE 7.1

http://www.mysql.com/why-mysql/white-papers/mysql_wp_cluster_manager.php

• Cluster-Wide Management• Process Management• On-Line Operations (Upgrades / Reconfiguration)

Automated Management

• Status Monitoring & Recovery

Monitoring

• Disk Persistence• Configuration Consistency• HA Agent Operation

HA Operations

Friday, 25 June 2010

Creating & Starting a Cluster

1.Define the site:Mysql> create site --hosts=192.168.0.10,192.168.0.11,-> 192.168.0.12,192.168.0.13 mysite;

2.Expand the MySQL Cluster tar-ball(s) from mysql.com to known directory

3.Define the package(s):Mysql> add package --basedir=/usr/local/mysql_6_3_26 6.3;Mysql> add package --basedir=/usr/local/mysql_7_0_7 7.0;

Note that the basedir should match the directory used in Step 2.

4. Create the ClusterMysql> create cluster --package=6.3-> [email protected],[email protected],-> [email protected],[email protected], [email protected],-> [email protected],[email protected],[email protected] -> mycluster;

This is where you define what nodes/processes make up the Cluster and where they should run

5. Start the Cluster:Mysql> start cluster mycluster;

agent

1. ndb_mgmd

7. mysqld

192.168.0.10

agent

2. ndb_mgmd

8. mysqld

192.168.0.11

agent

5. ndbd

3. ndbd

192.168.0.12

agent

6. ndbd

4. ndbd

192.168.0.13

mysqlclient

http://www.mysql.com/why-mysql/white-papers/mysql_wp_cluster_manager.phpFriday, 25 June 2010

Setting Cluster parameters

Example: Turn of privilege checking for all MySQL Servers and change the port for connecting to the mysqld with ID = 8 to 3307. Allow data nodes to be automatically restarted after they fail:

mysql> set skip_grant_tables:mysqld=true,--> port:mysqld:8=3307,--> StopOnError:ndbd=false mycluster;

MySQL Cluster Manager automatically determines which nodes (processes) need to be restarted and in which order to make the change take effect but avoid loss of service

agent

1. ndb_mgmd

7. mysqld

192.168.0.10

agent

2. ndb_mgmd

8. mysqld

192.168.0.11

agent

5. ndbd

3. ndbd

192.168.0.12

agent

6. ndbd

4. ndbd

192.168.0.13

mysqlclient

http://www.mysql.com/why-mysql/white-papers/mysql_wp_cluster_manager.phpFriday, 25 June 2010

Upgrade Cluster

• Upgrade from MySQL Cluster 6.3.26 to 7.0.7:

mysql> upgrade cluster --package=7.0 mycluster;

• Automatically upgrades each node and restarts the process – in the correct order to avoid any loss of service

• Without MySQL Cluster Manager, the administrator must stop each process in turn, start the process with the new version and wait for the node to restart before moving onto the next one

agent

1. ndb_mgmd

7. mysqld

192.168.0.10

agent

2. ndb_mgmd

8. mysqld

192.168.0.11

agent

5. ndbd

3. ndbd

192.168.0.12

agent

6. ndbd

4. ndbd

192.168.0.13

mysqlclient

http://www.mysql.com/why-mysql/white-papers/mysql_wp_cluster_manager.phpFriday, 25 June 2010

Thank You

Have a look Now

http://www.mysql.com/products/database/cluster/

[email protected]://clusterdb.com

Friday, 25 June 2010

Friday, 25 June 2010

<Insert Picture Here>

MySQL EnterpriseIvan ZorattiSales Consulting Manager EMEA

1006.01Friday, 25 June 2010

The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions.The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle.

Friday, 25 June 2010

MySQL Product Offering and Licensing

EnterpriseGPL

• Significantly improved release-management, testing, certification and service

• Services to ensure the maximum quality, uptime, and performance of MySQL Enterprise systems

• Around-the-clock support for the MySQL Enterprise server, along with consultative services and self-help knowledge aids

• Extended Lifecycle Support

CommercialLicence

• Sold to OEMs and ISVs

• Frees from applying GPL rules to source code and IP

Embedded Server

CommunityGPL

• Available under GPL• Software tested by the

Community• Bleeding edge• No Maintenance SLA• Not Supported• No ISV Certification

Community Server

Friday, 25 June 2010

MySQL Comparison ChartFeature

Open Source - GPL License ✔ ✔

Open Source - Commercial License ✔ Option

Benefits from testing by worldwide Community ✔ ✔ ✔

Feature Releases Mature Mature Mature

Benchmarked with 2,000+ connections ✔ ✔

Rapid Update Service Pack Program ✔ ✔ ✔

Quarterly Service Pack Program ✔ ✔

Hot Fix Program ✔ ✔

MySQL Enterprise Monitor and Advisors ✔

MySQL Query Analyzer ✔

Bug Escalation Privilege ✔ ✔

Live feeds for Software/Support Status updates ✔ ✔

Online Knowledge Base ✔ ✔

24x7 Production/Consulting Support Services ✔ ✔

Extended End-of-Life Support Policy ✔ ✔

Legal indemnification ✔ ✔

Community Server Embedded Server

Friday, 25 June 2010

• Subscription:• MySQL Enterprise

• License (OEM):• Embedded Server• Support

• MySQL Cluster Carrier-Grade

• Training• Consulting• NRE

Database

Monitoring

Support

• MySQL Enterprise Server • Monthly Rapid Updates• Quarterly Service Packs• Hot Fix Program• Extended End-of-Life

• Global Monitoring of All Servers• Web-Based Central Console• Built-in Advisors, Expert Advice• MySQL Query Analyzer • Specialised Scale-Out Help

• 24 x 7 x 365 Problem Resolution• Online Self help Knowledge Base• Consultative Help• Bug Escalation Program

MySQL Enterprise: Commercial Offering

http://www.mysql.com/products/enterprise/Friday, 25 June 2010

• Single, consolidated view into entire MySQL environment

• Monitor MySQL Sessions, Connections, Replication Latency

• Improve Application Performance

• Gain Immediate Visibility into Your Replication Topologies

• Customisable rules-based monitoring and alerts

• Identifies problems before they occur

• Makes it easier to scale out without requiring more DBAs A Virtual MySQL DBA Assistant!

MySQL Enterprise Monitor

http://www.mysql.com/products/enterprise/monitor.htmlFriday, 25 June 2010

MySQL Enterprise Monitor ArchitectureIndividual Servers w/Agent

Master-Slave Replication

Enterprise Dashboard

Service Manager

Repository

Collects MySQL and OS specific metrics, Query

content/stats

Holds historical MySQL and OS data, Query Statistics

Advisor Monitoring Event based Alerts

Advice/Corrective Actions

ConfigurationAdvisor SchedulingAlerts/NotificationsVisual MonitoringQuery Analysis

Service Agent written in C and supports all MySQL Enterprise platforms

Service Manager written in Java servlets exposed as web services. Supports Linux, Solaris, Mac OSX and Microsoft Windows

Enterprise Dashboard Web-based, written in JSP

Repository holds historical performance data for analysis

Friday, 25 June 2010

MySQL Enterprise Monitor 2.2Spring 2010 Release

• Performance Optimization for Java and .NET applications

• Improved Performance Monitoring• MySQL Enterprise Connector Plugins to Query

Analyzer• MySQL Query Analyzer Advanced Search Options• New Query Analyzer Execution Notices

• Filter for Specific Query Problems • Full Table Scans, Bad Indexes

• Improved User/Security Model• New Read Only User• New LDAP Authentication

• Improved Integration with MySQL Support• New MySQL Support Diagnostic Reports

Friday, 25 June 2010

MySQL Enterprise Monitor 2.2Spring 2010 Release

• Improved Usability• New Auto-closing Events• New Searchable Graphs• New Custom Rule/Graph Import and Export• New Intelligent Installation Options• New Faster Purging of Repository Data• New UI Session Management

• Improved Advisor Rules and Graphs• New Advisor Rules and Graphs

• 600+ MySQL and OS variables• 140+ Rules• 40+ MySQL and OS Graphs

Friday, 25 June 2010

MySQL Enterprise Monitor 2.2

Friday, 25 June 2010

MySQL Query Analyzer

• Centralised monitoring of queries across all servers

• No reliance on Slow Query Logs, SHOW PROCESSLIST;, vmstat, etc.

• Aggregated view of query execution counts, time, and rows

• Saves time parsing atomic executions for total query expense

Friday, 25 June 2010

Monitoring Queries with MySQL Proxy

** MySQL Proxy is optionally deployed and configured as a plugin with the MySQL Agent

List of components to download & configure:

1. MySQL Enterprise Monitor & Query Analyzer2. MySQL Proxy & Agent

(SQL statements & result sets)‏

MySQL DatabaseApplication Server

3306

18080

6446

(MySQL, OS monitoring data, SQL performance data: statements, examples, EXPLAINs, aggregated stats)‏

1. MySQL Enterprise Monitor (Service Manager, Dashboard)

2. MySQL Proxy& MySQL Agent **

Friday, 25 June 2010

Connector Plugins to Query Analyzer

• Enable Query Analyzer without need for MySQL Proxy• More configuration options• Less overhead than proxied connection to database• Proxy for dev/QA,

Connectors for production• Adds query collection toConnector componentsused by most/all MySQLapplications

• Plugins available for:• Connector/J• Connector/Net

Friday, 25 June 2010

Monitoring Queries with Connector/J, .NET

1. MySQL Enterprise Monitor & Query Analyzer2. MySQL Agent3. Connector/J v5.1 or newer/ Connector/NET v6.2 or newer4. MySQL Enterprise Plugin for Connector/J, NET

List of components to download & configure:

MySQL Database

(SQL statements & result sets)‏

(MySQL & OS monitoring data)‏

3. Connector/J, NET

4. Plugin for Connector/J, NET

(SQL performance data: statements, examples, EXPLAINs, aggregated

stats)‏

3306

18080

2. MySQL Agent

1. MySQL Enterprise Monitor (Service Manager, Dashboard)‏

Application Server

Friday, 25 June 2010

What Promovacances.com is saying

The MySQL Query Analyzer has enabled us to save a huge amount of time. We can very quickly identify and analyze the SQL code causing problems on the most used queries and fix the issues. I highly recommend the MySQL Query Analyzer to all DBAs and developers who want the best performance for their applications.Guillaume Postaire, Infrastructure Manager, Promovacances.com

Friday, 25 June 2010

MySQL Enterprise Features

http://www.mysql.com/products/enterprise/features.html

MySQL Enterprise Basic Silver Gold PlatinumSoftwareMySQL Enterprise Server Pro Pro Advanced AdvancedMonthly Rapid Updates ✔ ✔ ✔ ✔

Quarterly Service Packs ✔ ✔ ✔ ✔

MySQL Connectors ✔ ✔ ✔ ✔

Add-on Products & ServicesMemcached for MySQL ✔ ✔

Software Update ServicesSoftware Updates Service ✔ ✔ ✔ ✔

Technical Alerts ✔ ✔ ✔ ✔

MySQL Enterprise MonitorEnterprise Dashboard ✔ ✔ ✔

Live Feeds, Notifications and Alerts ✔ ✔ ✔

Custom Advisor ✔ ✔ ✔

Upgrade Advisor ✔ ✔ ✔

Administration Advisor ✔ ✔ ✔

Security Advisor ✔ ✔ ✔

MySQL Query Analyzer ✔ ✔

Replication Monitor ✔ ✔

Replication Advisor ✔ ✔

Memory Usage Advisor ✔ ✔

Schema Advisor ✔

Performance Advisor ✔

Consultative SupportRemote Troubleshooting ✔ ✔

Replication Review ✔ ✔

Partitioning Review ✔ ✔

Query Review ✔

Schema Review ✔

Performance Tuning ✔

Customer Code Reviews: MySQL Client APIs ✔

Customer Code Reviews: MySQL User Defined Functions & Server Extensions ✔

Customer Code Reviews: MySQL Stored Procedures, Triggers & Functions ✔

Install Advantage Phone Phone, Remote Install Phone, Remote Install

Friday, 25 June 2010

MySQL Enterprise Features

http://www.mysql.com/products/enterprise/features.html

MySQL Enterprise Basic Silver Gold PlatinumProblem Resolution Support

Number of Incidents 2 Unlimited Unlimited Unlimited

Web-based Case Management ✔ ✔ ✔ ✔

Phone Access Business Hours 24x7 24x7

Support Access Business Hours Business Hours 24x7 24x7

Max Initial Response Time 2 bus. days 4 hours 2 hours 1 hour

Emergency 2 Response Time 1 hour 30m

Emergency 2 Bug Fix Escalation ✔ ✔

Emergency 2 Hot Fix Build ✔ ✔

Custom Build Option

Self Help Support

Knowledge Base ✔ ✔ ✔ ✔

Lifecycle/EOL Support

Active ✔ ✔ ✔ ✔

Extended ✔ ✔ ✔ ✔

Account Management

Technical Account Manager (TAM) Option

Proactive Case Mgmt. Option

Scheduled Status Calls Option

Scheduled Onsite Visits Option

Scheduled Environment & Performance Review Option

Indemnification

Indemnification Option Option

Unlimited

Unlimited Option Option

Friday, 25 June 2010

MySQL Enterprise Backup

• Formerly “InnoDB Hot Backup”• Online, non-locking backup & recovery

• Tables, Indexes• Server, database, or object-level

• Logical and physical backups• Full or incremental backups• Supports InnoDB and MyISAM• Cross-Platform (Windows, Linux, Unix)• Features

• Point-in-time recovery• Compressed backups• Partial Backup

Beta

Friday, 25 June 2010

MySQL Enterprise Backup 3.5

• Incremental Backup• Support for Barracuda file format

• Backup of compressed tables• Backup additional files such as partition files

• Backup of in-memory database with --exec-when-locked option

Beta

Friday, 25 June 2010

Backup Steps

1.Backup data files• Copy and compress data files• Omit free space and empty pages

2.Copy log records created during data file copy• All redo records with LSN > backup starting time• Portions of the log file that contain all the required redo

information3.Backup MyISAM files•FLUSH TABLES WITH READ LOCK

4.Execute additional actions under --exec-when-locked• FLUSH TABLES WITH READ LOCK• mysqldump

Friday, 25 June 2010

Restore Steps1.Uncompress and restore backup files2.Recreate InnoDB log files3.Apply log files4.Restore MyISAM and other files

Friday, 25 June 2010

Incremental and Partial Backup

• Incremental• Last backup or any point in time can be identified to start the

backup• Incremental backups must be restored in the right order

• Partial• Can be used with the “file per table” option• The system tablespace will always be backed up• Regular expressions are allowed to select tables and schemas

to back up

Friday, 25 June 2010

Friday, 25 June 2010

<Insert Picture Here>

MySQL WorkbenchAndrew MorganSenior Product Manager, MySQL Cluster

1006.01Friday, 25 June 2010

The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions.The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle.

Friday, 25 June 2010

MySQL Workbench 5.2

• Three Tools in One Product• SQL Editor• Database Administrator• Data Modeller

• Cross Platform and Native UI• Windows• Linux• Mac OS X

RC

http://dev.mysql.com/doc/index-gui.htmlFriday, 25 June 2010

Design, Develop, Admin

Administration

• Graphical interface for MySQL administrators

• Stop/Start, Check, Edit configuration

• Manage permissions, Import/Export data, more..

Development

• Graphical SQL IDE for developers

• Create and execute SQL queries, procedures, etc.

• Edit data inline with table results

Design

• Data modeling tool for developers, DBAs, architects

• Design new database designs from scratch

• Reverse engineer and edit existing databases

Friday, 25 June 2010

Tab-Oriented Workflow

•Quick Switching Between Contexts•Modelling and SQL Editor•Admin and SQL Editor

•Multiple DB Connections•Single Instance per Tab•Open as many Tabs as needed

Friday, 25 June 2010

SQL Editor UI

•Object Browser•Schema Browsing

•SQL Statements•Multiple tabs to work with several scripts

•Content Tabs•Overview

• MS Access like icon listing

•Output• MySQL Server output messages

•History• All executed SQL commands

•Snippets• User- / Pre-defined SQL scripts

•Result Set Tabs• One tab per result set

Friday, 25 June 2010

MySQL Model Tab

•Sidebar•Description for schema objects•User defined data types•History listing of all actions

•Model Overview•Lists all EER Diagrams•Physical Schema listing•Schema Privileges Management•SQL Scripts•Model Notes

Friday, 25 June 2010

Diagram Tab

•Sidebar•Bird’s Eye View•Catalog Tree•UI Layers Tree•User Datatypes•Description Editor•UI Figure Properties Editor

•Diagram•Worktool - Toolbar•Diagram Area

• Displays UI Figures for Schema Objects like Tables, Views, Routines• UI Figures for Layers, Notes, Images

Friday, 25 June 2010

Admin Tab

•Server Status•Displays CPU/Mem usage•Graphs for MySQL performance

•Configuration•MySQL Startup/Shutdown•my.ini Configuration•Account Management•Server Connection Listing•Server & Status Variables Browsing•Data Dump Export / Import•Log Table Browsing

Friday, 25 June 2010

Thank You

• Documentation: http://dev.mysql.com/doc• Blogs: http://planet.mysql.com• Forums: http://forums.mysql.com

[email protected]://clusterdb.com

Try it Now

http://dev.mysql.com/downloads/workbench/5.2.html

Friday, 25 June 2010

Friday, 25 June 2010