So, I’ve been looking around for a while (and a few times now) for any good resources that cover a bunch of MySQL architecture and technical details aimed towards the technically proficient but not MySQL literate audience. I haven’t really found anything. I mean, there’s the (huge and very detailed) MySQL manual, there’s the MySQL Internals manual (which is sometimes only 10 years out of date) and there’s various blog entries around the place. So I thought I’d write something explaining roughly how it all fits together and what it does to your system (processes, threads, IO etc).(Basically, I’ve found myself explaining this enough times in the past few years that I should really write it down and just point people to my blog). I’ve linked to things for more reading. You should probably …
[Read more]This week we are talking about size, which is a subject that should matter to any system administrator in charge of the backup system of any project, and in particular database backups.
I sometimes get questions about what should be the best compression tool to apply during a particular backup system: gzip? bzip2? any other?
The testing environment
In order to test several formats and tools, I created a .csv file (comma-separated values) that was 3,700,635,579 bytes in size by transforming a recent dump of all the OpenStreetMap nodes of the European portion of Spain. It had a total of 46,741,126 rows and looked like this:
171773 38.6048402 -0.0489871 4 2012-08-25 00:37:46 12850816 472193 rubensd 171774 38.6061981 -0.0496867 2 2008-01-19 10:23:21 666916 9250 …[Read more]
In my previous post I pointed out that the
existing ARCHIVE
storage engine in MySQL may
not be the one that will satisfy your needs when it comes to
effectively storing large and/or old data. But are there any good
alternatives? As the primary purpose of this engine is to store
rarely accessed data in disk space efficient way, I will focus
here on data compression abilities rather then on performance.
The InnoDB engine provides compressed row format, but is it’s efficiency even close to the one from that available in archive engine? You can also compress MyISAM tables by using myisampack tool, but that also means a table will be read only after such operation.
Moreover, I don’t trust MyISAM nor Archive when it comes to data durability. Fortunately along came a quite new (open source since April …
[Read more]A lot is said about the differences in the data between MySQL and MongoDB. Things such as “MongoDB is document based”, “MySQL is relational”, “InnoDB has a clustering key”, etc.. Some may wonder how TokuDB, our MySQL storage engine, and TokuMX, our MongoDB product, fit in with these data layouts. I could not find anything describing the differences with a simple google search, so I figured I’d write a post explaining how things compare.
So who are the players here? With MySQL, users are likely familiar with two storage engines: MyISAM, the original default up until …
[Read more]
CCM Benchmark is one of the leading forum provider on the web,
ROI is a major concern for them and historically
MyISAM was used on the forum replication cluster. Reason is
that MyISAM gave better ROI/performance on data that is hardly
electable to cache mechanism.
This post is for MySQL users at scale, if the number of
servers or datacenter cost is not an issue for you, better get
some more memory or flash storage and ou will found Lucifer
server to demonstrate that your investment is not a lost of money
or just migrate to Mongo.
Quoting Damien Mangin, CTO at CCM "I like my data to be small,
who want's to get to a post where the question is not popular and
have no answer. Despite cleaning we still get more data than what
commodity hardware memory can offer and storing all post in
memory would be a major waste of money".
Like many other big web players at an other scale, …
This blog post is part two in what is now a continuing series on the Star Schema Benchmark.
In my previous blog post I compared MySQL 5.5.30 to MySQL 5.6.10, both with default settings using only the InnoDB storage engine. In my testing I discovered that innodb_old_blocks_time had an effect on performance of the benchmark. There was some discussion in the comments and I promised to follow up with more SSB tests at a later date.
I also promised more low concurrency SSB tests when Peter blogged about the importance of performance at low concurrency.
The SSB
The SSB tests a database’s ability to optimize queries for a star
schema. A star …
Somebody asked why you can’t implement MySQL triggers that write information when you want to stop the DML statement, like autonomous procedures in Oracle. The question was a surprise but I didn’t find anything on it, so here’s how you can do it. This is more or less like an autonomous process by leveraging both the InnoDB and MyISAM engine’s behaviors. This post leverages an earlier explanation of MySQL Triggers.
- First you create a MyISAM table, which is a persistent store
that auto commits when you’re other InnoDB tables can be
transactionally dependent. Here’s a simple MyISAM
logger
table.
CREATE TABLE logger ( logger_id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY , logger_event VARCHAR(50) , logger_table VARCHAR(50) , logger_instring VARCHAR(100) , … |
Following on from my fun post on Where are they now: MySQL Storage Engines, I thought I’d cover the few storage engines that are really just interfaces to a collection of things. In this post, I’m talking about MERGE.
The MERGE engine was basically a multiplexer down to a number of MyISAM tables. They all had to be the same, there was no parallel query execution and it saw fairly limited use. One of the main benefits was that then you could actually put more rows in a MyISAM table than your “files up to 2/4GB” file system allowed. With the advent of partitioning, this really should have instantly gone away and been replaced by it. It wasn’t.
It is another MySQL feature that exists likely due to customer demand at the time. It’s not a complete solution by any means, PARTITIONING is way more complete and …
[Read more]
With MySQL 5.5 the default storage engine was changed to InnoDB.
This was a good step as most users expected MySQL to support
transactions, row level locking and all the other InnoDB
features, but with 5.1 they sometimes forgot to choose the right
storage engine. As most databases don't have multiple storage
engines and many MySQL users changed the default storage engine
to InnoDB this made the switch to MySQL easier and the default
behaviour more in line with what people expect from a relational
database.
Changing the storage engine can of course be done on a per table
or per instance basis (default-storage-engine in my.cnf). The
temporary tables created with 'CREATE TEMPORARY TABLE ...' should
not be forgotten. The performance of InnoDB or MyISAM for
temporary tables can have quite some impact, especially with slow
storage, a buffer pool which is too small to hold the complete
dataset or very small temporary tables. In MySQL 5.6 …
InnoDB Full-text Search in MySQL 5.6: Part 2, The Queries!
This is part 2 in a 3 part series. In part 1, we took a quick look at some initial configuration of InnoDB full-text search and discovered a little bit of quirky behavior; here, we are going to run some queries and compare the result sets. Our hope is that the one of two things will happen; either the results returned from a MyISAM FTS query will be exactly identical to the same query when performed against InnoDB data, OR that the results returned by InnoDB FTS will somehow be “better” (as much as it’s actually possible to do this in a single blog post) than what MyISAM gives us.
Recall that we have two different sets of …
[Read more]