MySQL Conf 2008 – MySQL Proxy (Day 4)

MySQL Proxy is one of the new products that MySQL released this year that has some real promise. In the MySQL Proxy, the Friendly Man in the Middle session Jan Kneschke went over the existing and planned features of the proxy.

MySQL Proxy has a c-based event driven core that has command line support, event handling and a Lua-based scripting layer. The proxy is loading into MySQL via the plugin interface. With the community edition, you are responsible for writing your own scripts. But with MySQL Enterprise, it will come with several pre-built scripts that add some enhanced functionality.

The most basic use of MySQL Proxy is to rewrite or alter your queries. If you have a costly query that is killing your db, but you’re not sure where it is coming from, you can write a Lua script to either reject the query or to alter it and make it more manageable. It stops the dba from having to wait for a developer to update code and/or deploy the fix.

Another trick you can do with MySQL Proxy is to create new SQL commands. While this is probably not going to be a great idea, you can see a few interesting examples at http://thenoyes.com/littlenoise/?p=63. It is a good way to expand on functionality at the lowest level. Or to lose/forget where you put it when you switch to another db. 😉

Read More…

Posted under Events, mysql

This post was written by Michael Tougeron on April 21, 2008

Tags: , , ,

MySQL Conf 2008 – Maria Engine (Day 3)

Wednesday afternoon Monty went through the Architecture of Maria, what the new features are and what its roadmap will be. For those of you who are not aware of Maria, it is a new db engine that Monty announced back in January.

Maria was designed to be a crash-safe replacement for MyISAM. Maria supports the same row formats and features as MyISAM. This means it can be fully compatible with MyISAM by simply running it in non-transactional control. It will be ACID compliant and have multi-version concurrency control (MVCC).

Read More…

Posted under Events, mysql

This post was written by Michael Tougeron on April 17, 2008

Tags: , , , ,

MySQL Conf 2008 – Applied Partitioning (Day 3)

The Applied Partitioning and Scaling Your Database System session by Phil Hildebrand appears to be a very popular session. The line outside the door was more of a crowd than a line. The talk was about the new partitioning abilities of MySQL 5.1.

The new table partitioning system has several benefits for your large datasets where you are having performance issues due to the volume of data. It can reduce the seek & scan set sizes and reduce the INSERT/UPDATE transaction durations. If you are already performing UNION queries or secondary queries to find data in an archive table, this functionality may be for you.

There are four (point 5) partitioning styles available for your use:

  1. Range
    • Very useful for situations where the data is accessed by date
    • Usually used when a limited number of primary partitions are needed
    • It supports sub-partitions (the .5 partition type)
  2. List
    • Good for when you are grouping data in partitions out of order (e.g., SELECT 1,5,7 in partition X)
    • As the name implies, you list which data goes into which partition
    • Higher maintenance costs in many situations
    • Supports sub-partitions
  3. Hash
    • Usually has a lower maintenance cost
    • Partitions the data based on the hash that you tell it
    • Good for when you have non-intelligent keys
    • Works with both a limited and a large number of Partitions
  4. Key
    • Similar to Hash partitioning, but based on one or more of the fields in the primary key instead of a user-defined hash
    • If there is no primary key, then the first unique index is used
    • Does not require the key to be integer based
  5. Subpartitions
    • As the name implies, a partition within a partition
    • You can only create subpartitions for Range & List
    • If needed, subpartitions can be spread across volumes

The alter table statements are fairly simplistic; “ALTER TABLE my_table PARTITION BY KEY() PARTITIONS 50” will create 50 partitions for that table.  If you need to add more partitions, you can just run “ALTER TABLE my_table ADD PARTITION PARTITIONS 25” and your table will now have 75 partitions.  Of course you can shrink the size of the partitions as well.  One of the nice features of the partition modification is that the data is re-allocated as appropriate.

All in all, this looks like a much better solution than the standard 10/90 tables.

Posted under Events, mysql

This post was written by Michael Tougeron on April 16, 2008

Tags: , , ,

MySQL Conf 2008 – MySQL Sandbox (Day 3)

This morning’s first session is hosted by Giuseppe Maxia about MySQL Sandbox. This tool was created so that you can quickly & easily setup sandbox servers for testing MySQL. It installs side servers on a machine that is already running MySQL. Sandbox installs quickly without disturbing the existing MySQL installation.

The home for the MySQL Sandbox project is hosted on SourceForge.net. It is not an officially supported product which is why Giuseppe keeps it on SourceForge.

The Sandbox was designed so that you don’t have to go through the hassle, and potentially error prone, steps of setting up multiple sandbox databases. It’s very common for these manual installations to accidentally install in the same data directory (can corrupt your data) or install with the same port/socket (MySQL won’t start).

Details of installing and using after the break… Read More…

Posted under Events, mysql

This post was written by Michael Tougeron on April 16, 2008

Tags: , , ,

MySQL Conf 2008 – InnoDB (Day 2)

A new version for InnoDB was announced today. During the InnoDB: Fast, Reliable, Proven Transactional Storage for MySQL session Heikki Tuuri and Ken Jacobs (Heikki’s handler) went over the changes and improvements. InnoDB is now using MySQL 5.1’s plugin API and has some very cool/interesting new features, including:
Fast index creation – Add/drop indexes without copying the data.
Data compression – Significantly reduces storage size & I/O by shrinking the tables.
New row format – Off-page storage of large data elements like BLOB, TEXT, etc.

The new format of InnoDB can be dynamically installed w/o re-linking MySQL, which should be pretty handy for people who cannot easily re-build MySQL. The InnoDB upgrade is fully compatible with existing InnoDB tables and can even be downgraded back to the old version if you need to.

Installation is a breeze and can be done by downloading, extracting the ha_innodb.so into the MySQL Server plugin directory, and then restarting the mysqld. Be sure to enable “skip_innodb” in the my.cnf so that it doesn’t conflict with the engine already in MySQL. The innodb_file_format is now Barracuda. Finally log into the cli and “INSTALL PLUGIN INNODB SONAME ‘ha_innodb.so'” and “INSTALL PLUGIN INNODB_LOCKS SONAME ‘ha_innodb.s'”

Read More…

Posted under Events, mysql

This post was written by Michael Tougeron on April 15, 2008

Tags: , ,