MySQL Limitations Part 3: Subqueries

The following query will surprise users unpleasantly:

select * from a where a.id in (select id from b);

Users expect the inner query to execute first, then the results to be substituted into the IN() list. But what happens instead is usually a full scan or index scan of table a, followed by N queries to table b. This is because MySQL rewrites the query to make the inner query dependent on the outer query, which could be an optimization in some cases, but de-optimizes the query in many other cases.


Yoshinori Matsunobu’s blog: Using MySQL as a NoSQL – A story for exceeding 750,000 qps on a commodity server

We are using “only MySQL”. We still use memcached for front-end caching (i.e. preprocessed HTML, count/summary info), but we do not use memcached for caching rows. We do not use NoSQL, either. Why? Because we could get much better performance from MySQL than from other NoSQL products. In our benchmarks, we could get 750,000+ qps on a commodity MySQL/InnoDB 5.1 server from remote web clients. We also have got excellent performance on production environments.


Scaling writes in MySQL

After partitioning, tests showed that we could sustain an insert rate of 10K rows per second for some time. As the table size grew past 10 million records, the insert rate dropped to about 8500 rows per second, but it stayed at that rate for well over 44 million records. I tested inserts up to 350 million records and we were able to sustain an insert rate of around 8500 rows per second. Coincidentally, during Michael Jackson’s memorial service, we actually did hit an incoming rate of a little over 8000 records per second for a few hours.


Multi-Master Replication Manager for MySQL [MMM for MySQL Wiki]

MMM (Multi-Master Replication Manager for MySQL) is a set of flexible scripts to perform monitoring/failover and management of MySQL master-master replication configurations (with only one node writable at any time).

The toolset also has the ability to read balance standard master/slave configurations with any number of slaves, so you can use it to move virtual IP addresses around a group of servers depending on whether they are behind in replication.


mk-log-parser

mk-log-parser reads MySQL log files and generates a report that’s useful for optimizing a server. It can also perform other actions, such as helping you do a query review by showing all distinct queries running on your server.
mk-log-parser reads the files you specify on the command line, or standard input.


Using MySQL’s Built-In Replication To Maximize Availability

MySQL’s internal replication is built on a master-slave relationship between two or more servers, with one acting as the master, and any number acting as slaves. I’ll walk through configuring two servers as a master slave pair, describing the process as we move through it.

step by step instructions on setting up master-slave replication on MySQL

Load More