<<style class="greenbox" style="text-align:center;font-family:Droid Sans;font-weight:bold;font-size:1.2em;">>
[[http://downloads.askmonty.org/mariadb/5.3|Download MariaDB 5.3]]
<</style>>
<<style class="bluebox" style="text-align:center;font-size:0.8em;font-family:Droid Sans;">>
MariaDB 5.3.7 [[mariadb-537-release-notes|Release Notes]] | [[mariadb-537-changelog|Changelog]]\\
MariaDB 5.3.6-ga [[mariadb-536-release-notes|Release Notes]] | [[mariadb-536-changelog|Changelog]]\\
MariaDB 5.3.5-ga [[mariadb-535-release-notes|Release Notes]] | [[mariadb-535-changelog|Changelog]]\\
MariaDB 5.3.4-rc [[mariadb-534-release-notes|Release Notes]] | [[mariadb-534-changelog|Changelog]]\\
MariaDB 5.3.3-rc [[mariadb-533-release-notes|Release Notes]] | [[mariadb-533-changelog|Changelog]]\\
MariaDB 5.3.2-beta [[mariadb-532-release-notes|Release Notes]] | [[mariadb-532-changelog|Changelog]]\\
MariaDB 5.3.1-beta [[mariadb-531-release-notes|Release Notes]] | [[mariadb-531-changelog|Changelog]]\\
MariaDB 5.3.0-beta [[mariadb-530-release-notes|Release Notes]] | [[mariadb-530-changelog|Changelog]]\\
<</style>>
<<toc>>
The focus for MariaDB 5.3 is to radically improve performance for
subqueries, as well as for joins and single-table queries over large
data sets.
MariaDB 5.3 is based on MariaDB 5.2 and thus on MariaDB 5.1 and MySQL 5.1.
Some of the code was backported from MySQL 6.0 (a MySQL version that was never
released as GA by Oracle), some was re-engineered and enriched by new features,
and some code was written from scratch.
Any new feature or combination of features can be switched on/off dynamically via the
[[mariadb-53-optimizer_switch|optimizer_switch]] system variable.
The first stable (GA) release of MariaDB 5.3 was
[[mariadb-535-release-notes|MariaDB 5.3.5]], which was released on 29 Feb 2012.
You can download
[[http://downloads.askmonty.org/MariaDB/5.3/|the latest binaries of MariaDB 5.3 here]],
or get the latest
[[source-getting-the-mariadb-source-code|source code from launchpad]].
== Feature Comparison Matrix
We have created an [[optimizer-feature-comparison-matrix|Optimizer Feature Comparison Matrix]] showing the new optimizer features in MariaDB 5.5 and 5.3 compared to MySQL 5.5 and 5.6.
== Query optimizer
=== Subquery optimizations
Subqueries are finally usable in practice. It is no longer necessary to
rewrite subqueries manually into joins or into separate queries. MariaDB 5.3
aims to provide reasonably efficient handling for all kinds of subqueries.
All problems with ##EXPLAIN## taking a long time have also been resolved.
* [[semi-join-subquery-optimizations|Semi-join subquery optimizations]]\\
These transform subqueries into 'semi-joins', entities similar to inner joins,
and then use join optimizer to pick the best semi-join execution strategy. Overall
the process is similar to how joins are processed in MySQL,MariaDB and other database systems.
** [[table-pullout-optimization|Table pullout optimization]]
** [[firstmatch-strategy|FirstMatch execution strategy]]
** [[semi-join-materialization-strategy|Semi-join Materialization execution strategy]]
** [[loosescan-strategy|LooseScan execution strategy]]
** [[duplicateweedout-strategy|DuplicateWeedout execution strategy]]
* [[non-semi-join-subquery-optimizations|Non-semi-join optimizations]]\\
If a subquery is not a semi-join, MariaDB 5.3 will make a cost-based choice between these two strategies:
** Materialization for non-correlated subqueries, with [[http://askmonty.org/worklog/Server-Sprint/?tid=68|efficient NULL-aware execution]]
** IN-to-EXISTS transformation (the only optimization inherited from MariaDB 5.2 and MySQL 5.1/5.5)
* [[subquery-cache|Subquery Cache]]\\
The subquery cache makes sure that subqueries are re-executed as few times as possible,
improving performance of already optimized subqueries.
* Subqueries are never executed during ##EXPLAIN##, thus resulting in almost
instant ##EXPLAIN##.
* DISTINCT and GROUP BY without HAVING are [[optimizing-group-by-and-distinct-clauses-in-subqueries|optimized away]] from subqueries.
The [[subquery-optimizations-map|Subquery Optimizations Map]] shows new subqueries optimizations graphically.
=== Optimizations for derived tables and views
* No early materialization of derived tables (e.g. subqueries in a ##FROM##
clause) and materialized views (##EXPLAIN## is always instantaneous)
* Thanks to [[derived-table-with-key-optimization|Derived Table Merge optimization]], mergeable derived tables are now processed like mergeable VIEWs.
* [[derived-table-with-key-optimization|Derived Table with Keys]] optimization gives the optimizer an option to create indexes over materialized derived tables
* Fields of merge-able views and derived tables are involved now in all
optimizations employing equalities
=== Disk access optimization
* [[index-condition-pushdown|Index Condition Pushdown]]
* [[multi-range-read-optimization|Multi-Range-Read optimization (MRR)]]
** Key-ordered retrieval
=== Join optimizations
* [[block-based-join-algorithms|Block-based Join Algorithms]]
* Block Nested Loop algorithm can be used for outer joins
* Block Hash Join (classic algorithm) is implemented and can be used for any
equi-joins
* Block Index Join (Batch Key Access Join) is supported and can exploit the
benefits of ordered retrievals for primary and secondary keys provided by the
new implementation of [[multi-range-read-optimization|MRR]]
* All block based algorithms for joins can use the benefits of new incremental
join buffers
* All block based algorithms fully support outer joins including nested outer
joins
* All block based algorithms can use the benefits of the first match
optimization for semi-joins and the non-exist optimization for outer joins
* All block based algorithms for joins can exploit the benefits of index
condition push-down.
* The total memory space used by the query for join buffers can be limited now,
and block based algorithms can allocate join buffers up to their needs (not
exceeding the set limits).
* Condition over outer tables extracted from ON expressions of outer joins are
evaluated before inner tables are accessed (supported for both regular index
join and block index join)
* Early checks for nulls for the fields from any null-rejecting conditions are
performed
=== Index Merge improvements
* Correct optimization of index_merge vs range access: [[fair-choice-between-range-and-index_merge-optimizations|Fair choice between range and index_merge optimizations]]
* [[index_merge_sort_intersection|index_merge/sort_intersection]] strategy
=== Optimizer control
* [[mariadb-53-optimizer_switch|@@optimizer_switch variable]] can be used to turn on/off all new optimizations.
== NoSQL-style interfaces
* [[handlersocket|HandlerSocket]] plugin included.
* Faster [[handler-commands|HANDLER]] commands; [[handler-commands|HANDLER READ]] now also work with prepared statements.
* [[dynamic-columns|Dynamic Columns]] support.
== Replication and binary logging
* [[group-commit-for-the-binary-log|Group commit for the binary log]] <<entity>>mdash<</entity>>
MariaDB 5.3 implements group commit which works when using XtraDB with the
binary log enabled. (In previous MariaDB releases, and all MySQL releases at
the time of writing, group commit works in InnoDB/XtraDB when the binary log
is disabled, but stops working when the binary log is enabled).
* [[annotate_rows_log_event|Annotation of row-based replication events with the original SQL statement]] <<entity>>mdash<</entity>>
When using row-based replication, the binary log does not contain SQL
statements, only discrete single-row insert/update/delete //events//. This
can make it harder to read mysqlbinlog output and understand where in an
application a given event may have originated, complicating analysis and
debugging.This feature adds an option to include the original SQL statement as a
comment in the binary log (and shown in mysqlbinlog output) for row-based
replication events.
* [[binlog-event-checksums|Checksums for binlog events]]. This is a backport of
the same feature in MySQL 5.6. It was implemented in MWL#180.
* [[enhancements-for-start-transaction-with-consistent|Enhancements for START TRANSACTION WITH CONSISTENT SNAPSHOT]] <<entity>>mdash<</entity>>
In MariaDB 5.3, ##START TRANSACTION WITH CONSISTENT SNAPSHOT## now also works
with the binary log. This means it is possible to obtain the binlog position
corresponding to a transactional snapshot of the database without blocking
any other queries. This is used by the command
"##mysqldump## ##{{{--}}}single-transaction## ##{{{--}}}master-data##" to do a fully
non-blocking backup which can be used to provision a new slave.
"##START## ##TRANSACTION## ##WITH## ##CONSISTENT## ##SNAPSHOT##" now also
works consistently between transactions involving more than one storage
engine (currently XTraDB and PBXT support this).
* [[row-based-replication-with-no-primary-key|Row-based replication for tables with no primary key]] <<entity>>mdash<</entity>>
This feature can improve the performance of row-based replication on tables
that do not have a primary key (or other unique key), but which do have
another index that can help locate rows to update or delete. With this
feature, index cardinality information from ##ANALYZE TABLE## is considered
when selecting the index to use (before this feature is implemented, the
first index was selected unconditionally).
* ##mysqlbinlog## will now omit redundant ##use## statements
around ##BEGIN##, ##SAVEPOINT##, ##COMMIT##, and ##ROLLBACK## events when
reading MySQL 5.0 binlogs.
== Datatypes
* [[microseconds-in-mariadb|Microsecond]] support for [[now|NOW()]] and
[[timestamp]], [[time]], and [[datetime]] columns.
* [[cast|CAST()]] now supports AS DECIMAL[(M,D)] and AS INT.
* [[cast|CAST()]] and all other datetime/time functions now supports microsecond fully.
== Windows performance improvements
* Backported [[http://www.facebook.com/note.php?note_id=238505812835782|Windows performance patches]] from MySQL 5.5.
* Asynchronous IO in XtraDB
is [[http://www.facebook.com/note.php?note_id=238687382817625|redesigned]]
and is now faster, due to the use of IO completion ports.
* Additional durability option for XtraDB : ##innodb_flush_method## can now
be ##O_DSYNC##, like on Unixes. The effect of using this option is that the
log file is opened with ##FILE_FLAG_WRITETHROUGH##,
and ##FlushFileBuffers()## is not done. This may improve speed in write-heavy
scenarios.
* A new Windows [[installing-mariadb-msi-packages-on-windows|MSI installer]].
* Includes a GUI-tool, [[http://www.heidisql.com/|HeidiSQL]].
== Miscellaneous
* New status variables: ##Rows_tmp_read##, ##Handler_tmp_write##,
and ##Handler_tmp_update## which count what happens with internal temporary
tables. ##Rows_read##, ##Handler_write## and ##Handler_update## no longer
count operations on internal temporary tables.
* New status variable ##Handler_read_rnd_deleted##, which is number of deleted rows found and skipped while scanning a table. Before this was part of ##Handler_read_rnd_next##.
* New variable 'in_transaction' that is 1 if you are in a transaction, 0 otherwise.
* [[progress-reporting|Progress reports]] for ##ALTER TABLE##
and ##LOAD DATA INFILE##. In addition Aria tables gives progress reports
for ##REPAIR TABLE## and ##CHECK TABLE##. The progress can be seen
in ##SHOW PROCESSLIST##, ##INFORMATION_SCHEMA.PROCESSLIST## and is sent to
MariaDB clients that calls ##mysql_real_connect()## with the
new ##CLIENT_PROGRESS## flag. ##mysql## command line client supports the new
progress indications.
* [[enhancements-for-start-transaction-with-consistent|PBXT consistent commit ordering]] <<entity>>mdash<</entity>>
This feature implements the new commit ordering storage engine API in PBXT.
With this feature, it is possible to use
"##START TRANSACTION WITH CONSISTENT SNAPSHOT##" and get consistency among
transactions which involve both XtraDB and InnoDB. (Without this feature,
there is no such consistency guarantee. For example, even after running
"##START TRANSACTION WITH CONSISTENT SNAPSHOT##" it was still possible for
the InnoDB/XtraDB part of some transaction //T// to be visible and the PBXT
part of the same transaction //T// to not be visible.)
* MariaDB unique error numbers now start from ##1900## to not clash with MySQL
error numbers.
* {{{/*M!##### */}}} new [[comment-syntax|executed comment syntax]] that can be
used when you want use new MariaDB syntax but still want your program to be
compatible with MySQL.
* A MariaDB optimized version of [[http://www.mysqlfanboy.com/mytop|mytop]] is included in the MariaDB distribution.
* Enhanced [[data-manipulation-kill-connection-query|KILL syntax]]: <<code lang=text inline=false>>KILL [HARD | SOFT] [CONNECTION | QUERY] [thread_id | USER user_name]<</code>>
* <<code>>max_user_connections<</code>> (both the global variable and
the ##GRANT## option) can be set to ##-1## to stop users from connecting to
the server. The global <<code>>max_user_connections<</code>> variable does
not affect users with the <<code>>SUPER<</code>> privilege.
* The [[ignore|IGNORE]] directive does not ignore all errors (like fatal errors), only things that are safe to ignore.
You can access the MariaDB 5.3 tree from
[[https://launchpad.net/maria/5.3|launchpad]].