November 24, 2014

Speeding up GROUP BY if you want aproximate results

Doing performance analyzes today I wanted to count how many hits come to the pages which get more than couple of visits per day. We had SQL logs in the database so It was pretty simple query:

Unfortunately this query ran for over half an hour badly overloaded server and I had to kill […]

Using GROUP BY WITH ROLLUP for Reporting Performance Optimization

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. […]

Should MySQL Extend GROUP BY Syntax ?

Jan has a good article about finding the row matching some value in the group: This is one illustration of group by limitations in SQL language which is not offset by any MySQL specific extensions,yet As you can see if you want to get one row from the group which is sorted some way you […]

Wrong GROUP BY makes your queries fragile

This is probably well known issue for everyone having some MySQL experience or experience with any other SQL database. Still I see this problem in many production applications so it is worth to mention it, especially as it is connected to MySQL Performance. No it might not affect MySQL Performance per say but it limits […]

GROUP_CONCAT useful GROUP BY extension

(There is an updated version of this post here) MySQL has useful extention to the GROUP BY operation: function GROUP_CONCAT: GROUP_CONCAT(expr) – This function returns a string result with the concatenated non-NULL values from a group. Where it can be useful?

The power of MySQL’s GROUP_CONCAT

In the very early days of Percona Vadim wrote very nice post about GROUP_CONCAT. But I want to show you a bit more about it. When is GROUP_CONCAT useful? Usually while working with Support customers I recommend it when you have aggregation of many-to-many info. It makes the view simpler and more beautiful and it […]

Percona Server 5.5.18-23.0: Now with Group Commit!

Percona is glad to announce the release of Percona Server 5.5.18-23.0 on December 19th, 2011 (Downloads are available here and from the Percona Software Repositories). Based on MySQL 5.5.18, including all the bug fixes in it, Percona Server 5.5.18-23.0 is now the current stable release in the 5.5 series. All of Percona ‘s software is open-source and free, all the details of the release can […]

Testing the Group Commit Fix

As you may know, Kristian Nielsen made a fix for the Group Commit Problem which we many times wrote about. The fix came into MariaDB 5.3 and Mark Callaghan tested it recently . We ported this patch to Percona Server (it is not in the main branch yet), and here are the results of my […]

Pretending to fix broken group commit

The problem with broken group commit was discusses many times, bug report was reported 3.5 years ago and still not fixed in MySQL 5.0/5.1 (and most likely will not be in MySQL 5.1). Although the rough truth is this bug is very hard (if possible) to fix properly. In short words if you enable replication (log-bin) on server […]

Group commit and XA

Returning to post Group commit and real fsync I made several experiments: I ran sysbench update_key benchmarks without —log-bin, with —log-bin, and with —log-bin and —innodb-support-xa=0 (default value is 1). Results (in transactions / sec) threads without —log-bin —log-bin —log-bin and —innodb_support-xa=0 1 1218.68 614.94 1010.44 4 2686.36 667.77 1162.60 16 3993.59 666.14 1161.56 64 […]