2
.\" Title: \fBndb_desc\fR
3
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
4
.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
6
.\" Manual: MySQL Database System
10
.TH "\FBNDB_DESC\FR" "1" "03/01/2010" "MySQL 5\&.1" "MySQL Database System"
11
.\" -----------------------------------------------------------------
12
.\" * set default formatting
13
.\" -----------------------------------------------------------------
14
.\" disable hyphenation
16
.\" disable justification (adjust text to left margin only)
18
.\" -----------------------------------------------------------------
19
.\" * MAIN CONTENT STARTS HERE *
20
.\" -----------------------------------------------------------------
23
ndb_desc \- describe NDB tables
25
.HP \w'\fBndb_desc\ \fR\fB\fIoptions\fR\fR\ 'u
26
\fBndb_desc \fR\fB\fIoptions\fR\fR
30
provides a detailed description of one or more
40
ndb_desc \-c \fIconnect_string\fR \fItbl_name\fR \-d \fIdb_name\fR [\-p]
48
MySQL table creation and population statements:
56
id INT(11) NOT NULL AUTO_INCREMENT,
57
name VARCHAR(20) NOT NULL,
58
length_mm INT(11) NOT NULL,
59
weight_gm INT(11) NOT NULL,
63
INSERT INTO fish VALUES
64
(\'\',\'guppy\', 35, 2), (\'\',\'tuna\', 2500, 150000),
65
(\'\',\'shark\', 3000, 110000), (\'\',\'manta ray\', 1500, 50000),
66
(\'\',\'grouper\', 900, 125000), (\'\',\'puffer\', 250, 2500);
79
shell> \fB\&./ndb_desc \-c localhost fish \-d test \-p\fR
87
Number of attributes: 4
88
Number of primary keys: 1
89
Length of frm data: 311
95
TableStatus: Retrieved
97
id Int PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY AUTO_INCR
98
name Varchar(20;latin1_swedish_ci) NOT NULL AT=SHORT_VAR ST=MEMORY
99
length_mm Int NOT NULL AT=FIXED ST=MEMORY
100
weight_gm Int NOT NULL AT=FIXED ST=MEMORY
102
PRIMARY KEY(id) \- UniqueHashIndex
103
PRIMARY(id) \- OrderedIndex
104
uk$unique(name) \- UniqueHashIndex
105
uk(name) \- OrderedIndex
106
\-\- Per partition info \-\-
107
Partition Row count Commit count Frag fixed memory Frag varsized memory Extent_space Free extent_space
108
0 2 2 32768 32768 0 0
109
1 4 4 32768 32768 0 0
110
NDBT_ProgramExit: 0 \- OK
116
Information about multiple tables can be obtained in a single invocation of
118
by using their names, separated by spaces\&. All of the tables must be in the same database\&.
124
columns were added in MySQL Cluster NDB 6\&.3\&.27 and MySQL Cluster NDB 7\&.0\&.8\&. They are applicable only to
126
tables having columns on disk; for tables having only in\-memory columns, these columns always contain the value
129
To illustrate their use, we modify the previous example\&. First, we must create the necessary Disk Data objects, as shown here:
135
CREATE LOGFILE GROUP lg_1
136
ADD UNDOFILE \'undo_1\&.log\'
140
ALTER LOGFILE GROUP lg_1
141
ADD UNDOFILE \'undo_2\&.log\'
144
CREATE TABLESPACE ts_1
145
ADD DATAFILE \'data_1\&.dat\'
146
USE LOGFILE GROUP lg_1
149
ALTER TABLESPACE ts_1
150
ADD DATAFILE \'data_2\&.dat\'
158
(For more information on the statements just shown and the objects created by them, see
159
Section\ \&17.5.10.1, \(lqMySQL Cluster Disk Data Objects\(rq, as well as
160
Section\ \&12.1.14, \(lqCREATE LOGFILE GROUP Syntax\(rq, and
161
Section\ \&12.1.18, \(lqCREATE TABLESPACE Syntax\(rq\&.)
163
Now we can create and populate a version of the
165
table that stores 2 of its columns on disk (deleting the previous version of the table first, if it already exists):
172
id INT(11) NOT NULL AUTO_INCREMENT,
173
name VARCHAR(20) NOT NULL,
174
length_mm INT(11) NOT NULL,
175
weight_gm INT(11) NOT NULL,
178
) TABLESPACE ts_1 STORAGE DISK
180
INSERT INTO fish VALUES
181
(\'\',\'guppy\', 35, 2), (\'\',\'tuna\', 2500, 150000),
182
(\'\',\'shark\', 3000, 110000), (\'\',\'manta ray\', 1500, 50000),
183
(\'\',\'grouper\', 900, 125000), (\'\',\'puffer\', 250, 2500);
189
When run against this version of the table,
191
displays the following output:
197
shell> \fB\&./ndb_desc \-c localhost fish \-d test \-p\fR
205
Number of attributes: 4
206
Number of primary keys: 1
207
Length of frm data: 321
213
TableStatus: Retrieved
215
id Int PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY AUTO_INCR
216
name Varchar(20;latin1_swedish_ci) NOT NULL AT=SHORT_VAR ST=MEMORY
217
length_mm Int NOT NULL AT=FIXED ST=DISK
218
weight_gm Int NOT NULL AT=FIXED ST=DISK
220
PRIMARY KEY(id) \- UniqueHashIndex
221
PRIMARY(id) \- OrderedIndex
222
uk$unique(name) \- UniqueHashIndex
223
uk(name) \- OrderedIndex
224
\-\- Per partition info \-\-
225
Partition Row count Commit count Frag fixed memory Frag varsized memory Extent_space Free extent_space
226
0 2 2 32768 32768 1048576 1044440
227
1 4 4 32768 32768 1048576 1044400
228
NDBT_ProgramExit: 0 \- OK
234
This means that 1048576 bytes are allocated from the tablespace for this table on each partition, of which 1044440 bytes remain free for additional storage\&. In other words, 1048576 \- 1044440 = 4136 bytes per partition is currently being used to store the data from this table\'s disk\-based columns\&. The number of bytes shown as
236
is available for storing on\-disk column data from the
238
table only; for this reason, it is not visible when selecting from the
239
INFORMATION_SCHEMA\&.FILES
242
\fBAdditional Options\fR:
252
.\" ndb_desc: extra-partition-info option
253
.\" extra-partition-info option: ndb_desc
254
\fB\-\-extra\-partition\-info\fR,
257
Print additional information about the table\'s partitions\&.
268
.\" ndb_desc: blob-info option
269
.\" blob-info option: ndb_desc
270
\fB\-\-blob\-info\fR,
273
Include information about subordinate
279
Use of this option also requires the use of the
280
\fB\-\-extra\-partition\-info\fR
281
(\fB\-p\fR) option\&.
283
This option was added in MySQL Cluster NDB 6\&.3\&.32, MySQL Cluster NDB 7\&.0\&.13, and MySQL Cluster NDB 7\&.1\&.2\&.
288
Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc.
290
This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
292
This documentation is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
294
You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/.
297
For more information, please refer to the MySQL Reference Manual,
298
which may already be installed locally and which is also available
299
online at http://dev.mysql.com/doc/.
301
Sun Microsystems, Inc. (http://www.mysql.com/).