Some time ago I wrote about MySQL 5.5 semi-synchronous replication. Since then, I have wanted to benchmark the overhead of semi-synchronous replication with a decent server. Now the occasion presented itself, thanks to some related business that I had to benchmark, and thus I did a few simple runs with and without semi-synchronous replication enabled, to see the impact of this feature on performance. If you haven't read the article on semi-synchronous replication, the bottom line is that, with this feature enabled, the master waits until at least one slave has acknowledged receipt for the data before returning a positive result to the client. This means that for each commit there are two network calls between master and slave. My gut feeling was that this feature would be costly in terms of query response time, although I was not prepared to …
[Read more]The latest from the MySQL community
Ideas, releases, practical guides, and perspectives from the people building with MySQL.
Shard-Query is an open source tool kit which helps
improve the performance of queries against a MySQL database by
distributing the work over multiple machines and/or multiple
cores. This is similar to the divide and conquer approach that
Hive takes in combination with Hadoop.
Shard-Query applies a clever approach to parallelism which allows
it to significantly improve the performance of queries by
spreading the work over all available compute resources. In this
test, Shard-Query averages a nearly 6x (max over 10x) improvement
over the baseline, as shown in the following graph:
One significant advantage of Shard-Query over Hive is that it works with existing MySQL data sets and queries. Another advantage is that it works with all MySQL …
[Read more]Note: We said this was episode 44, but it's really episode 43!
In this episode we give the basics of how replication works, giving knowledge about the fundamentals about replication to better understand why it has certain limitations and benefits.
Slave IO thread states in SHOW
PROCESSLIST
mk-table-checksum
MIXED binary log format defaults to STATEMENT,
unless certain conditions apply, which are listed at that link.
This week we talk about what's new in MySQL 5.6 and the return of labs.mysql.com. We also feature people's reactions to the 5.6 announcement and a special song by Solomon Chang (lyrics below).
Show notes:
If you want to see it for youreslf, there is a video
from the O'Reilly Conference of Tomas Ulin's Keynote, "State
of the Dolphin".
Olav Sandstå's blog post on index condition pushdown optimization.
…
[Read more]
MySQL’s SHOW PROFILES command and its profiling
support is something that I can’t believe I hadn’t spotted before
today.
It allows you to enable profiling for a session and then record
performance information about the queries executed. It shows
details of the different stages in the query execution (as
usually displayed in the thread state output of SHOW
PROCESSLIST) and how long each of these stages took.
I’ll demonstrate using an example. First within our session we need to enable profiling, you should only do this in sessions that you want to profile as there’s some overhead in performing/recording the profiling information:
mysql> SET profiling=1; Query OK, 0 rows affected (0.00 sec)
Now let’s run a couple of regular SELECT queries
mysql> SELECT COUNT(*) FROM myTable WHERE extra LIKE '%zkddj%'; +----------+ | COUNT(*) | +----------+ | 0 | …[Read more]
Following up to my previous blog on graphing statement execution in performance_schema, Sunny Bains on the InnoDB team pointed out that in looking at the INSERT graph, he didn’t think I had atomic operations enabled within my build.
Particularly here (from trunk):
225 /******************************************************************//**
226 Increments lock_word the specified amount and returns new value.
227 @return lock->lock_word after increment */
228 UNIV_INLINE
229 lint
230 rw_lock_lock_word_incr(
231 /*===================*/
232 rw_lock_t* lock, /*!< in/out: rw-lock */
233 ulint amount) /*!< in: amount of increment */
234 {
235 #ifdef …[Read more]
MySQL is the most popular open source SQL database. The ever-increasing performance demands of web-based services have generated significant interest in providing NoSQL access methods to MySQL. Today, MySQL is announcing the preview of the NoSQL to InnoDB via memcached. This offering provides users with the best of both worlds – maintain all of the advantages of rich SQL query language, while providing better performance for simple queries via direct access to shared data.
In this preview release, memcached is implemented as a MySQL plugin daemon, accessing InnoDB directly via the native InnoDB API:
Features provided in the current release:
- Memcached as a daemon plugin of mysqld: both mysqld and memcached are running in the same process space, with very low latency access to data …
For those interested in InnoDB internals, this post tries to explain why the global kernel mutex was required and the new mutexes and rw-locks that now replace it. Along with the long term benefit from this change.
InnoDB’s core sub-systems up to v5.5 are protected by a global mutex called the Kernel mutex. This makes it difficult to do even some common sense optimisations. In the past we tried optimising the code but it would invariably upset the delicate balance that was achieved by tuning of the code that used the global Kernel mutex, leading to unexpected performance regression. The kernel mutex is also abused in several places to cover operations unrelated to the core e.g., some counters in the server thread main loop.
The InnoDB core sub-systems are:
- The Locking sub-system
- The Transaction sub-system
- MVCC views …
Background
InnoDB gathers statistics for the data in user tables, which are used by the MySQL optimizer to choose the best query plan. For a long time the imprecision and instability of these statistics have been creating problems for users.
The problem is that these statistics are recalculated at any of the following events:
* When the table is opened
* When the table has changed a lot (1/16th of the table has been updated/deleted or inserted)
* When ANALYZE TABLE is run
* When SHOW TABLE STATUS or SHOW INDEX FROM is run
* When InnoDB Monitor is turned ON
* others
and so their recalculation must be quick an unnoticeable. Thus the quick algorithm just picks 8 random pages and could give a wildly varying results.
…
[Read more]One of the most important things a database user or DBA wants to know is what columns, indexes etc. a table has. There are a few ways to find these things out, such as show tables. However, to really reveal all of the detailed metadata information in an InnoDB database, many have tried the “innodb_table_monitor” to peek into internal data dictionary. By creating an “innodb_table_monitor” table, InnoDB will print out the contents of metadata periodically. Unfortunately, it is printed out in an unstructured text for each table, and to find out what you need you would have to either carefully scan the output or have your own parser to do some additional analysis on the result if you want to display them systematically.
Well, in the MySQL 5.6 release, “innodb_table_monitor” can become history, and you will no longer need to search the text output to find out system metadata information. Instead, you can query the InnoDB internal …
[Read more]