~ubuntu-branches/ubuntu/precise/mysql-5.1/precise

« back to all changes in this revision

Viewing changes to man/ndb_desc.1

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Tretkowski
  • Date: 2010-03-17 14:56:02 UTC
  • Revision ID: james.westby@ubuntu.com-20100317145602-x7e30l1b2sb5s6w6
Tags: upstream-5.1.45
ImportĀ upstreamĀ versionĀ 5.1.45

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
'\" t
 
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/>
 
5
.\"      Date: 03/01/2010
 
6
.\"    Manual: MySQL Database System
 
7
.\"    Source: MySQL 5.1
 
8
.\"  Language: English
 
9
.\"
 
10
.TH "\FBNDB_DESC\FR" "1" "03/01/2010" "MySQL 5\&.1" "MySQL Database System"
 
11
.\" -----------------------------------------------------------------
 
12
.\" * set default formatting
 
13
.\" -----------------------------------------------------------------
 
14
.\" disable hyphenation
 
15
.nh
 
16
.\" disable justification (adjust text to left margin only)
 
17
.ad l
 
18
.\" -----------------------------------------------------------------
 
19
.\" * MAIN CONTENT STARTS HERE *
 
20
.\" -----------------------------------------------------------------
 
21
.\" ndb_desc
 
22
.SH "NAME"
 
23
ndb_desc \- describe NDB tables
 
24
.SH "SYNOPSIS"
 
25
.HP \w'\fBndb_desc\ \fR\fB\fIoptions\fR\fR\ 'u
 
26
\fBndb_desc \fR\fB\fIoptions\fR\fR
 
27
.SH "DESCRIPTION"
 
28
.PP
 
29
\fBndb_desc\fR
 
30
provides a detailed description of one or more
 
31
NDB
 
32
tables\&.
 
33
.PP
 
34
\fBUsage\fR:
 
35
.sp
 
36
.if n \{\
 
37
.RS 4
 
38
.\}
 
39
.nf
 
40
ndb_desc \-c \fIconnect_string\fR \fItbl_name\fR \-d \fIdb_name\fR [\-p]
 
41
.fi
 
42
.if n \{\
 
43
.RE
 
44
.\}
 
45
.PP
 
46
\fBSample Output\fR:
 
47
.PP
 
48
MySQL table creation and population statements:
 
49
.sp
 
50
.if n \{\
 
51
.RS 4
 
52
.\}
 
53
.nf
 
54
USE test;
 
55
CREATE TABLE fish (
 
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,
 
60
    PRIMARY KEY pk (id),
 
61
    UNIQUE KEY uk (name)
 
62
) ENGINE=NDB;
 
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);
 
67
.fi
 
68
.if n \{\
 
69
.RE
 
70
.\}
 
71
.PP
 
72
Output from
 
73
\fBndb_desc\fR:
 
74
.sp
 
75
.if n \{\
 
76
.RS 4
 
77
.\}
 
78
.nf
 
79
shell> \fB\&./ndb_desc \-c localhost fish \-d test \-p\fR
 
80
\-\- fish \-\-
 
81
Version: 2
 
82
Fragment type: 9
 
83
K Value: 6
 
84
Min load factor: 78
 
85
Max load factor: 80
 
86
Temporary table: no
 
87
Number of attributes: 4
 
88
Number of primary keys: 1
 
89
Length of frm data: 311
 
90
Row Checksum: 1
 
91
Row GCI: 1
 
92
SingleUserMode: 0
 
93
ForceVarPart: 1
 
94
FragmentCount: 2
 
95
TableStatus: Retrieved
 
96
\-\- Attributes \-\-
 
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
 
101
\-\- Indexes \-\-
 
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
 
111
.fi
 
112
.if n \{\
 
113
.RE
 
114
.\}
 
115
.PP
 
116
Information about multiple tables can be obtained in a single invocation of
 
117
\fBndb_desc\fR
 
118
by using their names, separated by spaces\&. All of the tables must be in the same database\&.
 
119
.PP
 
120
The
 
121
Extent_space
 
122
and
 
123
Free extent_space
 
124
columns were added in MySQL Cluster NDB 6\&.3\&.27 and MySQL Cluster NDB 7\&.0\&.8\&. They are applicable only to
 
125
NDB
 
126
tables having columns on disk; for tables having only in\-memory columns, these columns always contain the value
 
127
0\&.
 
128
.PP
 
129
To illustrate their use, we modify the previous example\&. First, we must create the necessary Disk Data objects, as shown here:
 
130
.sp
 
131
.if n \{\
 
132
.RS 4
 
133
.\}
 
134
.nf
 
135
CREATE LOGFILE GROUP lg_1
 
136
    ADD UNDOFILE \'undo_1\&.log\'
 
137
    INITIAL_SIZE 16M
 
138
    UNDO_BUFFER_SIZE 2M
 
139
    ENGINE NDB;
 
140
ALTER LOGFILE GROUP lg_1
 
141
    ADD UNDOFILE \'undo_2\&.log\'
 
142
    INITIAL_SIZE 12M
 
143
    ENGINE NDB;
 
144
CREATE TABLESPACE ts_1
 
145
    ADD DATAFILE \'data_1\&.dat\'
 
146
    USE LOGFILE GROUP lg_1
 
147
    INITIAL_SIZE 32M
 
148
    ENGINE NDB;
 
149
ALTER TABLESPACE ts_1
 
150
    ADD DATAFILE \'data_2\&.dat\'
 
151
    INITIAL_SIZE 48M
 
152
    ENGINE NDB;
 
153
.fi
 
154
.if n \{\
 
155
.RE
 
156
.\}
 
157
.PP
 
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\&.)
 
162
.PP
 
163
Now we can create and populate a version of the
 
164
fish
 
165
table that stores 2 of its columns on disk (deleting the previous version of the table first, if it already exists):
 
166
.sp
 
167
.if n \{\
 
168
.RS 4
 
169
.\}
 
170
.nf
 
171
CREATE TABLE fish (
 
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,
 
176
    PRIMARY KEY pk (id),
 
177
    UNIQUE KEY uk (name)
 
178
) TABLESPACE ts_1 STORAGE DISK 
 
179
ENGINE=NDB;
 
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);
 
184
.fi
 
185
.if n \{\
 
186
.RE
 
187
.\}
 
188
.PP
 
189
When run against this version of the table,
 
190
\fBndb_desc\fR
 
191
displays the following output:
 
192
.sp
 
193
.if n \{\
 
194
.RS 4
 
195
.\}
 
196
.nf
 
197
shell> \fB\&./ndb_desc \-c localhost fish \-d test \-p\fR
 
198
\-\- fish \-\-
 
199
Version: 3
 
200
Fragment type: 9
 
201
K Value: 6
 
202
Min load factor: 78
 
203
Max load factor: 80
 
204
Temporary table: no
 
205
Number of attributes: 4
 
206
Number of primary keys: 1
 
207
Length of frm data: 321
 
208
Row Checksum: 1
 
209
Row GCI: 1
 
210
SingleUserMode: 0
 
211
ForceVarPart: 1
 
212
FragmentCount: 2
 
213
TableStatus: Retrieved
 
214
\-\- Attributes \-\-
 
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
 
219
\-\- Indexes \-\-
 
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
 
229
.fi
 
230
.if n \{\
 
231
.RE
 
232
.\}
 
233
.PP
 
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
 
235
Free extent_space
 
236
is available for storing on\-disk column data from the
 
237
fish
 
238
table only; for this reason, it is not visible when selecting from the
 
239
INFORMATION_SCHEMA\&.FILES
 
240
table\&.
 
241
.PP
 
242
\fBAdditional Options\fR:
 
243
.sp
 
244
.RS 4
 
245
.ie n \{\
 
246
\h'-04'\(bu\h'+03'\c
 
247
.\}
 
248
.el \{\
 
249
.sp -1
 
250
.IP \(bu 2.3
 
251
.\}
 
252
.\" ndb_desc: extra-partition-info option
 
253
.\" extra-partition-info option: ndb_desc
 
254
\fB\-\-extra\-partition\-info\fR,
 
255
\fB\-p\fR
 
256
.sp
 
257
Print additional information about the table\'s partitions\&.
 
258
.RE
 
259
.sp
 
260
.RS 4
 
261
.ie n \{\
 
262
\h'-04'\(bu\h'+03'\c
 
263
.\}
 
264
.el \{\
 
265
.sp -1
 
266
.IP \(bu 2.3
 
267
.\}
 
268
.\" ndb_desc: blob-info option
 
269
.\" blob-info option: ndb_desc
 
270
\fB\-\-blob\-info\fR,
 
271
\fB\-b\fR
 
272
.sp
 
273
Include information about subordinate
 
274
BLOB
 
275
and
 
276
TEXT
 
277
columns\&.
 
278
.sp
 
279
Use of this option also requires the use of the
 
280
\fB\-\-extra\-partition\-info\fR
 
281
(\fB\-p\fR) option\&.
 
282
.sp
 
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\&.
 
284
.RE
 
285
.SH "COPYRIGHT"
 
286
.br
 
287
.PP
 
288
Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc.
 
289
.PP
 
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.
 
291
.PP
 
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.
 
293
.PP
 
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/.
 
295
.sp
 
296
.SH "SEE ALSO"
 
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/.
 
300
.SH AUTHOR
 
301
Sun Microsystems, Inc. (http://www.mysql.com/).