Author: jstephens
Date: 2006-04-12 13:28:59 +0200 (Wed, 12 Apr 2006)
New Revision: 1804
Log:
Adding info about 4-byte alignment in CLuster to Storage Requirements section.
Fixes Docs Bug #13162.
Modified:
trunk/refman-4.1/data-types.xml
trunk/refman-5.0/data-types.xml
trunk/refman-5.1/data-types.xml
Modified: trunk/refman-4.1/data-types.xml
===================================================================
--- trunk/refman-4.1/data-types.xml 2006-04-12 04:42:48 UTC (rev 1803)
+++ trunk/refman-4.1/data-types.xml 2006-04-12 11:28:59 UTC (rev 1804)
@@ -5053,6 +5053,24 @@
<literal>TEXT</literal> column accounts for only five to nine
bytes toward this size.
</para>
+
+ <para>
+ <emphasis role="bold">Important</emphasis>: For tables using the
+ <literal>NDBCluster</literal> storage engine, there is the factor
+ of <firstterm>4-byte alignment</firstterm> to be taken into
+ account when calculating storage requirements. This means that all
+ <literal>NDB</literal> data storage is done in multiples of 4
+ bytes. Thus, a column value that — in a table using a
+ storage engine other than <literal>NDB</literal> — would
+ take 15 bytes for storage, requires 16 bytes in an
+ <literal>NDB</literal> table. This requirement applies in addition
+ to any other considerations that are discussed in this section.
+ For example, in <literal>NDBCluster</literal> tables, the
+ <literal>TINYINT</literal>, <literal>SMALLINT</literal>,
+ <literal>MEDIUMINT</literal>, and
<literal>INTEGER</literal>
+ (<literal>INT</literal>) column types each require 4 bytes storage
+ per record.
+ </para>
<indexterm>
<primary>numeric types</primary>
Modified: trunk/refman-5.0/data-types.xml
===================================================================
--- trunk/refman-5.0/data-types.xml 2006-04-12 04:42:48 UTC (rev 1803)
+++ trunk/refman-5.0/data-types.xml 2006-04-12 11:28:59 UTC (rev 1804)
@@ -4863,6 +4863,24 @@
<literal>TEXT</literal> column accounts for only five to nine
bytes toward this size.
</para>
+
+ <para>
+ <emphasis role="bold">Important</emphasis>: For tables using the
+ <literal>NDBCluster</literal> storage engine, there is the factor
+ of <firstterm>4-byte alignment</firstterm> to be taken into
+ account when calculating storage requirements. This means that all
+ <literal>NDB</literal> data storage is done in multiples of 4
+ bytes. Thus, a column value that — in a table using a
+ storage engine other than <literal>NDB</literal> — would
+ take 15 bytes for storage, requires 16 bytes in an
+ <literal>NDB</literal> table. This requirement applies in addition
+ to any other considerations that are discussed in this section.
+ For example, in <literal>NDBCluster</literal> tables, the
+ <literal>TINYINT</literal>, <literal>SMALLINT</literal>,
+ <literal>MEDIUMINT</literal>, and
<literal>INTEGER</literal>
+ (<literal>INT</literal>) column types each require 4 bytes storage
+ per record.
+ </para>
<indexterm>
<primary>numeric types</primary>
Modified: trunk/refman-5.1/data-types.xml
===================================================================
--- trunk/refman-5.1/data-types.xml 2006-04-12 04:42:48 UTC (rev 1803)
+++ trunk/refman-5.1/data-types.xml 2006-04-12 11:28:59 UTC (rev 1804)
@@ -4658,6 +4658,24 @@
<literal>TEXT</literal> column accounts for only five to nine
bytes toward this size.
</para>
+
+ <para>
+ <emphasis role="bold">Important</emphasis>: For tables using the
+ <literal>NDBCluster</literal> storage engine, there is the factor
+ of <firstterm>4-byte alignment</firstterm> to be taken into
+ account when calculating storage requirements. This means that all
+ <literal>NDB</literal> data storage is done in multiples of 4
+ bytes. Thus, a column value that — in a table using a
+ storage engine other than <literal>NDB</literal> — would
+ take 15 bytes for storage, requires 16 bytes in an
+ <literal>NDB</literal> table. This requirement applies in addition
+ to any other considerations that are discussed in this section.
+ For example, in <literal>NDBCluster</literal> tables, the
+ <literal>TINYINT</literal>, <literal>SMALLINT</literal>,
+ <literal>MEDIUMINT</literal>, and
<literal>INTEGER</literal>
+ (<literal>INT</literal>) column types each require 4 bytes storage
+ per record.
+ </para>
<indexterm>
<primary>numeric types</primary>
@@ -5024,11 +5042,19 @@
<para>
The <literal>NDBCLUSTER</literal> storage engine in MySQL 5.1
- supports true variable-width columns. This means that a
+ supports variable-width columns. This means that a
<literal>VARCHAR</literal> column in a MySQL Cluster table
requires the same amount of storage as it would using any other
- storage engine. This represents a change in behavior from earlier
- versions of <literal>NDBCLUSTER</literal>.
+ storage engine, with the exception that such values are 4-byte
+ aligned. Thus, the string <literal>'abcd'</literal> stored in a
+ <literal>VARCHAR(50)</literal> column using the
+ <literal>latin1</literal> character set requires 8 bytes (rather
+ than 6 bytes for the same column value in a
+ <literal>MyISAM</literal> table). This represents a change in
+ behavior from earlier versions of <literal>NDBCLUSTER</literal>,
+ where a <literal>VARCHAR(50)</literal> column would require 52
+ bytes storage per record regardless of the length of the string
+ being stored.
</para>
<para>
| Thread |
|---|
| • svn commit - mysqldoc@docsrva: r1804 - in trunk: refman-4.1 refman-5.0 refman-5.1 | jon | 12 Apr |