Posted by peter
Have you ever had a question about Innodb internal design or behavior which is not well covered in MySQL manual ? I surely had.
Now you have a great chance to have them answered !
Heikki Tuuri, Creator of Innodb will answer your Questions about Innodb at MySQL Performance Blog.
Please leave your questions as comments to this post by 5th of October and I will pass them to Heikki to reply merging with questions I have myself.
Note: due to Oracle policies Heikki will likely be unable to answer your questions about Innodb new features or timetables.
Posted by peter
Many Open Source software solutions use database per user (or set of tables per user) which starts to cause problems if it is used on massive scale (blog hosting, forum hosting etc), resulting of hundreds of thousands if not millions of tables per server which can become really inefficient.
It is especially inefficient with Innodb tables both in terms of space (some tables would keep only couple of small rows, but require at least 16K page in Innodb), keeping all tables open in Innodb dictionary and number of other challenges in IO management and recovery. For MyISAM it works better but still overhead can get significant because table_cache can’t be made large enough and so a lot of table reopens needs to happen which requires table header modification, which is costly.
Of course if you can simply rewrite software to store multiple users per table it is best way to go, however quite typically this is way too much work and also requires constant patches as new software versions come out.
[read more...]
Posted by peter
It always surprised me how little Innodb team seems to think about product usability/ease of use, when it comes to settings, performance management etc.
I could understand many things 5 years ago, like a lot of information being available only in hard to parse SHOW INNODB STATUS output or even uglier hacks with creating tables such as innodb_lock_monitor to get more detailed information free space specified in table comments (which need to be parsed) etc. 5 years ago Heikki was along and he had a lot to do to make things work well so a lot of these things were just done quick and dirty way.
It is however hard for me to understand why so many years later with significantly increased team not only many of these things remain unfixed but things are still done similar way ?
[read more...]
Posted by
peter @ 3:05 am ::
Innodb ::
Posted by Vadim
There was long played scalability issue with InnoDB auto-increment field. For details check Bug 16979. In short words the problem is in case of insert into table with auto-increment column the special AUTO_INC table level lock is obtained, instead of usual row-level locks. With many concurrent inserted threads this causes serious scalability problems, and in our consulting practice we had a lot of customers who was affected by InnoDB auto-inc. For several of them we even advised to replace auto-inc column by that or another solution.
Good news is the bug is fixed. Bad news is it is fixed only 5.1.22, which is not released yet.
I wonder if the fix is going to be ported to 5.0, as I mentioned it affected many production systems and not all of them are ready to upgrade to 5.1.
The interesting also is the fix introduces new system variable innodb_autoinc_lock_mode which determines behavior of InnoDB for tables with autoinc. I do not want to copy-paste MySQL documentation, the very good and informative description of the problem and solution is available here.
Posted by peter
26th of September, just after HighLoad conference I will have full day MySQL master class.
This time we will talk about Innodb Architecture and Performance Optimization and when will discuss some MySQL Performance Optimization and Scaling case studies from audience (or some of from my MySQL Consulting Practice if there would not be enough of them). As usually I’ll try to keep it very interactive and will try to answer any other MySQL Performance, Scaling and High Availability questions you might have.
Posted by peter
Every so often you need to perform sort results retrieved from MySQL when your WHERE clause goes beyound col=const values which would allow MySQL to still use second portion of the index for the order by. Ranges as well as IN lists make this optimization impossible, not even speaking about index merge optimization. Lets look at this example:
[read more...]
Posted by peter
Quite typical query for reporting applications is to find top X values. If you analyze Web Site logs you would look at most popular web pages or search engine keywords which bring you most of the traffic. If you’re looking at ecommerce reporting you may be interested in best selling product or top sales people. This information may often need simple select query, however what if you would like to show percents not just absolute value ?
[read more...]
Posted by peter
The more I work with MySQL Performance Optimization and Optimization for other applications the better I understand I have to less believe in common sense or common sense of documentation writers and do more benchmarks and performance research. I just recently wrote about rather surprising results with sort performance and today I’ve discovered even read_buffer_size selection may be less than obvious.
[read more...]
Posted by peter
I finally got my visa so I’m going to MySQL Developers meeting in Heidelberg, Germany next week.
Hopefully it will be great source of “technical insight” information, either from organized sessions or from developers themselves.
Plus I’m looking forward meeting a lot of friends our where both MySQL Developers and active community members.
Posted by peter
General query logging can be very handy in MySQL on profuction server for various debugging needs. Unfortunately you can’t switch it on and off without restarting server until MySQL 5.0.
What can you do in MySQL 5.0 and below ?
Use Our Patch - With this patch you can get all queries logged as slow queries (with times) and as you can change long-query-time online you can effectively enable and disable debug logging live. Note however this is not 100% equivalent for general query log - for example connects or queries with syntax errors will not be logged.
Enable logging to /dev/null You can enable queries to say “all_queries” log and symlink that to /dev/null. So when you will need to enable queries you can symlink it to something else and run “flush logs” so logs are reopened and written to the file in question. When you have debug info you can just switch it back. Using /dev/null as a target allows to eliminate a lot of log writing overhead and save disk space which can be consumed very fast otherwise. Of course it does not remove all logging overhead - but this should not be major for most applications.
Posted by
peter @ 3:19 am ::
tips ::