MySQL

The world's most popular open source database

Contact a MySQL Representative


  • MySQL.com
  • Developer Zone
  • Partners & Solutions
  • Customer Login
  • DevZone
  • Downloads
  • Documentation
  • Articles
  • Forums
  • Bugs
  • Forge
 
  • Archives

    • May 2008
    • April 2008
    • March 2008
    • February 2008
    • January 2008
    • December 2007
    • October 2007
    • September 2007
    • July 2007
    • June 2007
    • May 2007
    • April 2007
    • March 2007
    • February 2007
    • January 2007
    • December 2006
    • November 2006
    • July 2006
    • May 2006
    • April 2006
    • March 2006
    • January 2006
    • December 2005
    • October 2005
    • September 2005
  • Categories

    • Uncategorized (63)



Robin Schumacher
« Try out Falcon tablespaces
Excited about MySQL Workbench »

Improved handling of large Falcon transactions

In previous MySQL 6.0 alpha’s, the new Falcon engine didn’t handle ‘large’ transactions (meaning lots of rows inserted at one time) very well. You typically had to fall back to looping through the data with various commit points to get all the data inserted in a timely fashion.

The Falcon team should get some good kudos for putting out the latest alpha release that has much improved handling of large transactions. Below are just a few examples of large inserts on a Fedora Core box with a single CPU. Falcon was given a 200MB record cache size and InnoDB got a comparable 200MB buffer pool size.

mysql> show create table t_mG
*************************** 1. row ***************************
       Table: t_m
Create Table: CREATE TABLE `t_m` (
  `client_transaction_id` int(11) NOT NULL DEFAULT '0',
  `client_id` int(11) NOT NULL DEFAULT '0',
  `investment_id` int(11) NOT NULL DEFAULT '0',
  `action` varchar(10) NOT NULL,
  `price` decimal(12,2) NOT NULL DEFAULT '0.00',
  `number_of_units` int(11) NOT NULL DEFAULT '0',
  `transaction_status` varchar(10) NOT NULL,
  `transaction_sub_timestamp` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `transaction_comp_timestamp` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `description` varchar(200) DEFAULT NULL,
  `broker_id` bigint(10) DEFAULT NULL,
  `broker_commission` decimal(10,2) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1 row in set (0.03 sec)

mysql> select count(*) from t_m;
+----------+
| count(*) |
+----------+
|  2000000 |
+----------+

mysql> create table t_f engine=falcon select * from t_m where 1=2;
Query OK, 0 rows affected (0.05 sec)

mysql> create table t_i engine=innodb select * from t_m where 1=2;
Query OK, 0 rows affected (0.05 sec)

mysql> set autocommit=0;
Query OK, 0 rows affected (0.06 sec)

mysql> insert into t_f select * from t_m;
Query OK, 2000000 rows affected (42.06 sec)
Records: 2000000  Duplicates: 0  Warnings: 0

mysql> rollback;
Query OK, 0 rows affected (5.09 sec)

mysql> insert into t_i select * from t_m;
Query OK, 2000000 rows affected (45.73 sec)
Records: 2000000  Duplicates: 0  Warnings: 0

mysql> rollback;
Query OK, 0 rows affected (41.81 sec)

Much better than previous alpha releases… Still, there’s more work to be done as Falcon can still experience a memory exhaustion error (remember it performs transaction management in memory) when transactions get really large as in this 5.6 million row test:

mysql> insert into t_f select * from t_m_big;
ERROR 1296 (HY000): Got error 305 'record memory is exhausted' from Falcon

The Falcon team will be addressing this issue shortly so look for even better things to come in upcoming Beta releases.

This entry was posted on Wednesday, October 3rd, 2007 at 5:31 pm and is filed under Uncategorized. You can follow any responses to this entry through the RSS 2.0 feed. Responses are currently closed, but you can trackback from your own site.

Comments are closed.

Robin Schumacher is proudly powered by WordPress MU running on Blogs.mysql.com.
Entries (RSS) and Comments (RSS).