MySQL is a million times faster than MemSQL
A couple of days ago, the world’s technological press spread the PR of MemSQL - a new generation database from Nikita Shamgunov ( shamg ), which supposedly shows speed 30 times faster than MySQL and at the same time is “reliable by default”, as stated by them on the site.
MySQL representatives have not condescended to answer these obvious marketing slogans. But here's a former MySQL employee, Domas Mituzas, now a database specialist on Facebook and Wikipedia, still could not stand it and decided to figure out exactly how we were being deceived - and answer in the same way, that is, show examples where MemSQL works hundreds, thousands, and even a million times slower than MySQL.
The main thesis about the “30-fold increase in productivity”, as it turned out, was derived from MySQL performance tests with default parameters against MemSQL with default parameters. Cheating is already starting here, because the systems are forced to work in completely different environments: for example, the memory buffer in MemSQL, in fact, is unlimited, and in InnoDB it is set to 128 MB in MySQL 5.5 (and this is 16 times more than in 5.1 )
For write benchmarks, MemSQL compares with 2 GB transaction logs and InnoDB with 10 MB logs.
At the same time, for any benchmarks, writes Domas Mituzas, reliability is important. While InnoDB really verifies that the transactions have been saved to disk, MemSQL's “default reliability” only means that the record is logged in the transaction log, but this does not really guarantee that it will be saved to disk. MemSQL's transactional buffer works much like a mode
So what is the result? MemSQL runs 500 times slower in reliable transaction mode.
In read mode, MemSQL is capable of scanning 8 million rows per second on demand
SELECT * FROM table ORDER BY id DESC LIMIT 5;
Such a request is found everywhere; it shows the tops of different lists. MySQL executes it, normally moving along the index from record to record, while MemSQL is forced to grind the entire table and sort it again to execute the query. Even a query
So, MemSQL is a thousand times slower than MySQL, or a million times slower. On simple read requests.
In general, Domas Mituzas concludes that MemSQL is an excellent development and the fastest MySQL protocol available for some tasks, but it is not so much ahead of MySQL Cluster, and the developers of NDB Cluster also declare very high performance. However, MemSQL needs to be properly optimized for more typical usage patterns.
MySQL representatives have not condescended to answer these obvious marketing slogans. But here's a former MySQL employee, Domas Mituzas, now a database specialist on Facebook and Wikipedia, still could not stand it and decided to figure out exactly how we were being deceived - and answer in the same way, that is, show examples where MemSQL works hundreds, thousands, and even a million times slower than MySQL.
The main thesis about the “30-fold increase in productivity”, as it turned out, was derived from MySQL performance tests with default parameters against MemSQL with default parameters. Cheating is already starting here, because the systems are forced to work in completely different environments: for example, the memory buffer in MemSQL, in fact, is unlimited, and in InnoDB it is set to 128 MB in MySQL 5.5 (and this is 16 times more than in 5.1 )
For write benchmarks, MemSQL compares with 2 GB transaction logs and InnoDB with 10 MB logs.
At the same time, for any benchmarks, writes Domas Mituzas, reliability is important. While InnoDB really verifies that the transactions have been saved to disk, MemSQL's “default reliability” only means that the record is logged in the transaction log, but this does not really guarantee that it will be saved to disk. MemSQL's transactional buffer works much like a mode
innodb_flush_log_at_trx_commit=2. If you enable full transaction protection in MemSQL, then it will be a heartbreaking sight : the background process wakes up every 50 ms to record the transaction log. So what is the result? MemSQL runs 500 times slower in reliable transaction mode.
In read mode, MemSQL is capable of scanning 8 million rows per second on demand
SELECT COUNT(*), which is an excellent result. But here is the request:SELECT * FROM table ORDER BY id DESC LIMIT 5;
Such a request is found everywhere; it shows the tops of different lists. MySQL executes it, normally moving along the index from record to record, while MemSQL is forced to grind the entire table and sort it again to execute the query. Even a query
SELECT MAX(id)crawls the entire table. So, MemSQL is a thousand times slower than MySQL, or a million times slower. On simple read requests.
In general, Domas Mituzas concludes that MemSQL is an excellent development and the fastest MySQL protocol available for some tasks, but it is not so much ahead of MySQL Cluster, and the developers of NDB Cluster also declare very high performance. However, MemSQL needs to be properly optimized for more typical usage patterns.