MariaDB 5.3 is now GA, and MariaDB 5.5 is RC. One of the primary features in these releases is all-round coverage with subquery optimizations. Practically every kind of subquery available in SQL has got some new optimization.

We do a lot of testing, so these new optimizations should be now reasonably stable. What is missing is performance testing with real-world queries on real-world data. I expect most of the time you will see a speedup, however, there can also be cases where the new version will be slower. New optimizations make query plan search space much bigger, this means the new optimizer will have lots of room to make errors where previously was none.

Back at MySQL Ab, I could use bugs/support cases to do some analysis of how real-world queries are affected by the new optimizations.

Now, we don’t have access to that data anymore, and so are asking for help: If you’ve got some queries with subqueries, please try running them on the latest MariaDB 5.3 Stable or MariaDB 5.5 RC and let us know of the results.

@Przemek, thanks a lot! I and the rest of MariaDB team really appreciate getting feedback on our work.

Subquery cache should definitely work for double subqueries and UNIONs, I have no idea why you’re not seeing the speedup.

Perhaps, the dataset is such that the cache is not useful?

If you’re going to re-run the UNIONs/double-subquery cases, could you check the values of status variables subquery_cache_hit subquery_cache_miss before/after the query? (they show how subquery cache worked, see http://kb.askmonty.org/en/subquery-cache for details)