Author: js221926
Date: 2011-03-14 17:58:54 +0100 (Mon, 14 Mar 2011)
New Revision: 25376
Log:
Basic documentation for WL#5092 -- row image control / binlog_row_image
Modified:
trunk/dynamic-docs/changelog/mysqld-2.xml
trunk/dynamic-docs/command-optvars/mysqld.xml
trunk/refman-5.6/introduction.xml
trunk/refman-5.6/replication-options-core.xml
Modified: trunk/dynamic-docs/changelog/mysqld-2.xml
===================================================================
--- trunk/dynamic-docs/changelog/mysqld-2.xml 2011-03-14 15:32:58 UTC (rev 25375)
+++ trunk/dynamic-docs/changelog/mysqld-2.xml 2011-03-14 16:58:54 UTC (rev 25376)
Changed blocks: 1, Lines Added: 42, Lines Deleted: 0; 1699 bytes
@@ -10,6 +10,48 @@
<tags>
<highlight type="replication"/>
+ <manual type="RBR"/>
+ <manual type="row images"/>
+ <manual type="binlog_row_image"/>
+ </tags>
+
+ <bugs>
+ <fixes wlid="5092"/>
+ </bugs>
+
+ <versions>
+ <version ver="5.6.3"/>
+ </versions>
+
+ <message>
+
+ <para>
+ Added the <literal role="sysvar">binlog_row_image</literal>
+ server system variable, which can be used to enable row image
+ control for row-based replication. This means that you can
+ potentially save disk space, network resources, and memory usage
+ by the MySQL Server by logging only those columns that are
+ required for uniquely identifying rows, or which are actually
+ changed on each row, as opposed to logging all columns for each
+ and every row change event. In addition, you can use a
+ <quote>noblob</quote> mode where all columns, except for
+ unneeded <literal role="type">BLOB</literal> or
+ <literal role="type">TEXT</literal> columns, are logged.
+ </para>
+
+ <para>
+ For more information, see
+ <xref linkend="replication-sysvars-binlog"/>.
+ </para>
+
+ </message>
+
+ </logentry>
+
+ <logentry entrytype="feature">
+
+ <tags>
+ <highlight type="replication"/>
<manual type="SHOW SLAVE STATUS"/>
<manual type="Last_IO_Error"/>
<manual type="Last_SQL_Error"/>
Modified: trunk/dynamic-docs/command-optvars/mysqld.xml
===================================================================
--- trunk/dynamic-docs/command-optvars/mysqld.xml 2011-03-14 15:32:58 UTC (rev 25375)
+++ trunk/dynamic-docs/command-optvars/mysqld.xml 2011-03-14 16:58:54 UTC (rev 25376)
Changed blocks: 1, Lines Added: 30, Lines Deleted: 0; 1404 bytes
@@ -127,6 +127,36 @@
</mysqloption>
+ <mysqloption section="binlog" id="binlog_row_image">
+
+ <xrefto id="sysvar_binlog_row_image"/>
+
+ <name>binlog_row_image</name>
+
+ <shortdescription>
+ Use full or minimal images when logging row changes. Allowed
+ values are full, minimal, and noblob.
+ </shortdescription>
+
+ <types>
+ <vartype isdynamic="yes" class="system" scope="both" format="binlog_row_image=image_type"/>
+ <optype class="cmdline" format="--binlog-row-image=image_type"/>
+ </types>
+
+ <values vartype="enumeration" platform="all">
+ <value default="full"/>
+ <choice value="full">Log all columns</choice>
+ <choice value="minimal">Log only changed columns, and columns needed to identify rows</choice>
+ <choice value="noblob">Log all columns, except for unneeded BLOB and TEXT columns</choice>
+ </values>
+
+ <versions>
+ <manual version="5.6"/>
+ <introduced version="5.6.3"/>
+ </versions>
+
+ </mysqloption>
+
<mysqloption section="binlog" id="binlog_rows_query_log_events">
<xrefto id="sysvar_binlog_rows_query_log_events"/>
Modified: trunk/refman-5.6/introduction.xml
===================================================================
--- trunk/refman-5.6/introduction.xml 2011-03-14 15:32:58 UTC (rev 25375)
+++ trunk/refman-5.6/introduction.xml 2011-03-14 16:58:54 UTC (rev 25376)
Changed blocks: 1, Lines Added: 20, Lines Deleted: 0; 1334 bytes
@@ -477,6 +477,26 @@
</para>
</listitem>
+ <listitem>
+ <para>
+ MySQL row-based replication now supports row image control. By
+ logging only those columns required for uniquely identifying
+ and executing changes on each row (as opposed to all columns)
+ for each row change, it is possible to save disk space,
+ network resources, and memory usage. You can determine whether
+ full or minimal rows are logged by setting the
+ <literal role="sysvar">binlog_row_image</literal> server
+ system variable to one of the values
+ <literal>minimal</literal> (log required columns only),
+ <literal>full</literal> (log all columns), or
+ <literal>noblob</literal> (log all columns except for unneeded
+ <literal role="type">BLOB</literal> or
+ <literal role="type">TEXT</literal> columns). See
+ <xref linkend="replication-sysvars-binlog"/>, for more
+ information.
+ </para>
+ </listitem>
+
</itemizedlist>
<bridgehead>
Modified: trunk/refman-5.6/replication-options-core.xml
===================================================================
--- trunk/refman-5.6/replication-options-core.xml 2011-03-14 15:32:58 UTC (rev 25375)
+++ trunk/refman-5.6/replication-options-core.xml 2011-03-14 16:58:54 UTC (rev 25376)
Changed blocks: 1, Lines Added: 117, Lines Deleted: 0; 5321 bytes
@@ -3556,6 +3556,123 @@
</listitem>
<listitem>
+ <para id="sysvar_binlog_row_image">
+ <indexterm>
+ <primary>binlog_row_image system variable</primary>
+ </indexterm>
+
+ <indexterm>
+ <primary>system variable</primary>
+ <secondary>binlog_row_image</secondary>
+ </indexterm>
+
+ <literal role="sysvar">binlog_row_image</literal>
+ </para>
+
+ <para condition="dynamic:optvar:item" role="5.6:mysqld:binlog_row_image"/>
+
+ <para>
+ In MySQL row-based replication, each row change event contains
+ two images, a <quote>before</quote> image whose columns are
+ matched against when searching for the row to be updated, and
+ an <quote>after</quote> image containing the changes.
+ Normally, MySQL logs full rows (that is, all columns) for both
+ the before and after images. However, it is not strictly
+ necessary to include every column in both images, and we can
+ often save disk, memory, and network usage by logging only
+ those columns which are actually required.
+ </para>
+
+ <note>
+ <para>
+ When deleting a row, only the before image is logged, since
+ there are no changed values to propagate following the
+ deletion. When inserting a row, only the after image is
+ logged, since there is no existing row to be matched. Only
+ when updating a row are both the before and after images
+ required, and both written to the binary log.
+ </para>
+ </note>
+
+ <para>
+ For the before image, it is necessary only that the minimum
+ set of columns required to uniquely identify rows is logged.
+ If the table containing the row has a primary key, then only
+ the primary key column or columns are written to the binary
+ log. Otherwise, if the table has a unique key all of whose
+ columns are <literal>NOT NULL</literal>, then only the columns
+ in the unique key need be logged. (If the table has neither a
+ primary key nor a unique key without any
+ <literal>NULL</literal> columns, then all columns must be used
+ in the before image, and logged.) In the after image, it is
+ necessary to log only the columns which have actually changed.
+ </para>
+
+ <para>
+ Beginning with MySQL 5.6.3, you can cause the server to log
+ full or minimal rows using the
+ <literal>binlog_row_image</literal> system variable. This
+ variable actually takes one of three possible values, as shown
+ in the following list:
+ </para>
+
+ <itemizedlist>
+
+ <listitem>
+ <para>
+ <literal>full</literal>: Log all columns in both the
+ before image and the after image.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <literal>minimal</literal>: Log only those columns in the
+ before image that are required to identify the row to be
+ changed; log only those columns in the after image that
+ are actually changed.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <literal>noblob</literal>: Log all columns (same as
+ <literal>full</literal>), except for
+ <literal role="type">BLOB</literal> and
+ <literal role="type">TEXT</literal> columns that are not
+ required to identify rows, or that have not changed.
+ </para>
+ </listitem>
+
+ </itemizedlist>
+
+ <para>
+ The default value is <literal>full</literal>. Previous to
+ MySQL 5.6.3, full row images are always used for both before
+ images and after images. If you need to replicate from a MySQL
+ 5.6.3 or later master to slave running a previous version of
+ MySQL, the master should always use this value.
+ </para>
+
+ <para>
+ Setting this variable has no effect when the binary logging
+ format is <literal>STATEMENT</literal>. When
+ <literal role="sysvar">binlog_format</literal> is
+ <literal>MIXED</literal>, the setting for
+ <literal>binlog_row_image</literal> is applied to changes that
+ are logged using row-based format, but this setting no effect
+ on changes logged as statements.
+ </para>
+
+ <para>
+ Setting <literal>binlog_row_image</literal> on either the
+ global or session level does not cause an implicit commit;
+ this means that this variable can be changed while a
+ transaction is in progress without affecting the transaction.
+ </para>
+ </listitem>
+
+ <listitem>
<para id="sysvar_binlog_stmt_cache_size">
<indexterm>
<primary>binlog_stmt_cache_size system variable</primary>
| Thread |
|---|
| • svn commit - mysqldoc@oter02: r25376 - in trunk: dynamic-docs/changelog dynamic-docs/command-optvars refman-5.6 | jon.stephens | 14 Mar |