Over the last few weeks I have been doing some work on improving
the concurrency performance of PBXT. The last Alpha version (1.0.03) has
quite a few problems in this area.
Most of the problems have been with r/w lock and mutex contention
but, I soon discovered that MySQL has some serious problems of
it's own. In fact, I had to remove some of the bottlenecks in
MySQL in order to continue the optimization of PBXT.
The result for simple SELECT performance is shown in the graph
below.
Here you can see that the gain is over 60% for 32
or more concurrent threads. Both results show the performance
with the newly optimized version of PBXT. The test is running on
a 2.16 MHz dual core processor, so I expect an even greater
improvement on 4 or 8 cores. The query I ran for this test is …
First some of the things that you need to use and
understand
Explain Syntax
Order by Optimization
Group by Optimization
Update: Updated errors.
Now some details that are usually missed. GROUP BY does sorting
unless you tell mysql not to. GROUP BY has two optimization
methods, loose index scan, and tight index scan.
Loose index scan, scans the entire table index, while tight index
scan uses some sort of constraint. For large datasets that are
accessed often and require some sort of group by, tight index
scans are better.
So how to pick columns to create …
How often do you think about the reasons why your favorite RDBMS sucks? Last few months I was doing this quite often and yes, my favorite RDBMS is MySQL. The reason why I was thinking so because one of my recent tasks at Scribd was fixing scalability problems in documents browsing.
The problem with browsing was pretty simple to describe and as hard to fix - we have large data set which consists of a few tables with many fields with really bad selectivity (flag fields like is_deleted, is_private, etc; file_type, language_id , category_id and others). As the result of this situation it becomes really hard (if possible at all) to display documents lists like “most popular 1-10 pages PDF documents in Italian language from the category “Business” (of course, non-deleted, …
[Read more]
The video of one of my three sessions, "Optimizing MySQL and InnoDB on Solaris 10 for World's
Largest Photo Blogging Community", presented at MySQL Conference & Expo 2008 has been uploaded
by Sheeri. I
am very thankful to her for doing all the hard work and making it
available.
There are a few slides that were edited out of video because of
reasons beyond my control. However, you should still be able to
enjoy most of the video.
There is one point related to this video that I would like to
make: Based on my particular experience I was leading to believe
that Solaris 10 Kernel had the …
At the 2008 MySQL Conference and Expo, The Pythian Group
gave away EXPLAIN
cheatsheets. They were very nice,
printed in full color and laminated to ensure you can spill your
coffee* on it and it will survive.
For those not at the conference, or those that want to make more, the file is downloadable as a 136Kb PDF at explain-diagram.pdf
* or tea, for those of us in the civilized world.
Here are two basic tips for proper indexing ...Don't mess with datatypes, too often people refer to an attribute defining it as one datatype in a table and as another in different tables, this actually prevents index usage in joins (forget about FKs for this time ;)) See an example here. You could declare a function based index as a workaround, but why don't we all try to make it right?Put
A
Whew! I just finished a marathon of revisions. It's been a while since I posted about our progress, so here's an update for the curious readers.
It's been a while since I've written about progress on the book. I actually stopped working on it as much at the beginning of the month, because on October 31(st) I managed to finish a first draft of the last big chapter! Now I'm back to full-time work at my employer, and I'm working on the book in the evenings and weekends only. Read on for details of what I've been working on and what's next in the pipeline.
I've been trying to circle back and clean up things I left for later in several chapters of High Performance MySQL, second edition. This includes a lot of material in chapter 4, Schema Optimization and Indexing. At some point I'll write more about the process of writing this book, and what we've done well and what we've learned to do better, but for right now I wanted to complete the picture of what material we have on schema, index, and query optimization. The last two chapters I've written about (Query Performance Optimization and Advanced MySQL Features) have generated lots of feed back along the lines …
[Read more]