~vadim-tk/percona-server/percona-galera-5.1.57

« back to all changes in this revision

Viewing changes to man/ndb_desc.1

  • Committer: root
  • Date: 2011-07-10 16:09:24 UTC
  • Revision ID: root@r815.office.percona.com-20110710160924-fyffqsbaclgu6vui
Initial port

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: 04/12/2011
 
6
.\"    Manual: MySQL Database System
 
7
.\"    Source: MySQL 5.1
 
8
.\"  Language: English
 
9
.\"
 
10
.TH "\FBNDB_DESC\FR" "1" "04/12/2011" "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
          Usage
 
34
.sp
 
35
.if n \{\
 
36
.RS 4
 
37
.\}
 
38
.nf
 
39
ndb_desc \-c \fIconnect_string\fR \fItbl_name\fR \-d \fIdb_name\fR [\-p]
 
40
.fi
 
41
.if n \{\
 
42
.RE
 
43
.\}
 
44
.sp
 
45
          Sample Output
 
46
        .PP
 
47
MySQL table creation and population statements:
 
48
.sp
 
49
.if n \{\
 
50
.RS 4
 
51
.\}
 
52
.nf
 
53
USE test;
 
54
CREATE TABLE fish (
 
55
    id INT(11) NOT NULL AUTO_INCREMENT,
 
56
    name VARCHAR(20) NOT NULL,
 
57
    length_mm INT(11) NOT NULL,
 
58
    weight_gm INT(11) NOT NULL,
 
59
    PRIMARY KEY pk (id),
 
60
    UNIQUE KEY uk (name)
 
61
) ENGINE=NDB;
 
62
INSERT INTO fish VALUES
 
63
    (\'\',\'guppy\', 35, 2), (\'\',\'tuna\', 2500, 150000),
 
64
    (\'\',\'shark\', 3000, 110000), (\'\',\'manta ray\', 1500, 50000),
 
65
    (\'\',\'grouper\', 900, 125000), (\'\',\'puffer\', 250, 2500);
 
66
.fi
 
67
.if n \{\
 
68
.RE
 
69
.\}
 
70
.PP
 
71
Output from
 
72
\fBndb_desc\fR:
 
73
.sp
 
74
.if n \{\
 
75
.RS 4
 
76
.\}
 
77
.nf
 
78
shell> \fB\&./ndb_desc \-c localhost fish \-d test \-p\fR
 
79
\-\- fish \-\-
 
80
Version: 2
 
81
Fragment type: 9
 
82
K Value: 6
 
83
Min load factor: 78
 
84
Max load factor: 80
 
85
Temporary table: no
 
86
Number of attributes: 4
 
87
Number of primary keys: 1
 
88
Length of frm data: 311
 
89
Row Checksum: 1
 
90
Row GCI: 1
 
91
SingleUserMode: 0
 
92
ForceVarPart: 1
 
93
FragmentCount: 2
 
94
TableStatus: Retrieved
 
95
\-\- Attributes \-\-
 
96
id Int PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY AUTO_INCR
 
97
name Varchar(20;latin1_swedish_ci) NOT NULL AT=SHORT_VAR ST=MEMORY
 
98
length_mm Int NOT NULL AT=FIXED ST=MEMORY
 
99
weight_gm Int NOT NULL AT=FIXED ST=MEMORY
 
100
\-\- Indexes \-\-
 
101
PRIMARY KEY(id) \- UniqueHashIndex
 
102
PRIMARY(id) \- OrderedIndex
 
103
uk$unique(name) \- UniqueHashIndex
 
104
uk(name) \- OrderedIndex
 
105
\-\- Per partition info \-\-
 
106
Partition  Row count  Commit count  Frag fixed memory  Frag varsized memory  Extent_space  Free extent_space
 
107
0          2          2             32768              32768                 0             0
 
108
1          4          4             32768              32768                 0             0
 
109
NDBT_ProgramExit: 0 \- OK
 
110
.fi
 
111
.if n \{\
 
112
.RE
 
113
.\}
 
114
.PP
 
115
Information about multiple tables can be obtained in a single invocation of
 
116
\fBndb_desc\fR
 
117
by using their names, separated by spaces\&. All of the tables must be in the same database\&.
 
118
.PP
 
119
The
 
120
Extent_space
 
121
and
 
122
Free extent_space
 
123
columns were added in MySQL Cluster NDB 6\&.3\&.27 and MySQL Cluster NDB 7\&.0\&.8\&. They are applicable only to
 
124
NDB
 
125
tables having columns on disk; for tables having only in\-memory columns, these columns always contain the value
 
126
0\&.
 
127
.PP
 
128
To illustrate their use, we modify the previous example\&. First, we must create the necessary Disk Data objects, as shown here:
 
129
.sp
 
130
.if n \{\
 
131
.RS 4
 
132
.\}
 
133
.nf
 
134
CREATE LOGFILE GROUP lg_1
 
135
    ADD UNDOFILE \'undo_1\&.log\'
 
136
    INITIAL_SIZE 16M
 
137
    UNDO_BUFFER_SIZE 2M
 
138
    ENGINE NDB;
 
139
ALTER LOGFILE GROUP lg_1
 
140
    ADD UNDOFILE \'undo_2\&.log\'
 
141
    INITIAL_SIZE 12M
 
142
    ENGINE NDB;
 
143
CREATE TABLESPACE ts_1
 
144
    ADD DATAFILE \'data_1\&.dat\'
 
145
    USE LOGFILE GROUP lg_1
 
146
    INITIAL_SIZE 32M
 
147
    ENGINE NDB;
 
148
ALTER TABLESPACE ts_1
 
149
    ADD DATAFILE \'data_2\&.dat\'
 
150
    INITIAL_SIZE 48M
 
151
    ENGINE NDB;
 
152
.fi
 
153
.if n \{\
 
154
.RE
 
155
.\}
 
156
.PP
 
157
(For more information on the statements just shown and the objects created by them, see
 
158
Section\ \&16.5.10.1, \(lqMySQL Cluster Disk Data Objects\(rq, as well as
 
159
Section\ \&12.1.14, \(lqCREATE LOGFILE GROUP Syntax\(rq, and
 
160
Section\ \&12.1.18, \(lqCREATE TABLESPACE Syntax\(rq\&.)
 
161
.PP
 
162
Now we can create and populate a version of the
 
163
fish
 
164
table that stores 2 of its columns on disk (deleting the previous version of the table first, if it already exists):
 
165
.sp
 
166
.if n \{\
 
167
.RS 4
 
168
.\}
 
169
.nf
 
170
CREATE TABLE fish (
 
171
    id INT(11) NOT NULL AUTO_INCREMENT,
 
172
    name VARCHAR(20) NOT NULL,
 
173
    length_mm INT(11) NOT NULL,
 
174
    weight_gm INT(11) NOT NULL,
 
175
    PRIMARY KEY pk (id),
 
176
    UNIQUE KEY uk (name)
 
177
) TABLESPACE ts_1 STORAGE DISK 
 
178
ENGINE=NDB;
 
179
INSERT INTO fish VALUES
 
180
    (\'\',\'guppy\', 35, 2), (\'\',\'tuna\', 2500, 150000),
 
181
    (\'\',\'shark\', 3000, 110000), (\'\',\'manta ray\', 1500, 50000),
 
182
    (\'\',\'grouper\', 900, 125000), (\'\',\'puffer\', 250, 2500);
 
183
.fi
 
184
.if n \{\
 
185
.RE
 
186
.\}
 
187
.PP
 
188
When run against this version of the table,
 
189
\fBndb_desc\fR
 
190
displays the following output:
 
191
.sp
 
192
.if n \{\
 
193
.RS 4
 
194
.\}
 
195
.nf
 
196
shell> \fB\&./ndb_desc \-c localhost fish \-d test \-p\fR
 
197
\-\- fish \-\-
 
198
Version: 3
 
199
Fragment type: 9
 
200
K Value: 6
 
201
Min load factor: 78
 
202
Max load factor: 80
 
203
Temporary table: no
 
204
Number of attributes: 4
 
205
Number of primary keys: 1
 
206
Length of frm data: 321
 
207
Row Checksum: 1
 
208
Row GCI: 1
 
209
SingleUserMode: 0
 
210
ForceVarPart: 1
 
211
FragmentCount: 2
 
212
TableStatus: Retrieved
 
213
\-\- Attributes \-\-
 
214
id Int PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY AUTO_INCR
 
215
name Varchar(20;latin1_swedish_ci) NOT NULL AT=SHORT_VAR ST=MEMORY
 
216
length_mm Int NOT NULL AT=FIXED ST=DISK
 
217
weight_gm Int NOT NULL AT=FIXED ST=DISK
 
218
\-\- Indexes \-\-
 
219
PRIMARY KEY(id) \- UniqueHashIndex
 
220
PRIMARY(id) \- OrderedIndex
 
221
uk$unique(name) \- UniqueHashIndex
 
222
uk(name) \- OrderedIndex
 
223
\-\- Per partition info \-\-
 
224
Partition  Row count  Commit count  Frag fixed memory  Frag varsized memory  Extent_space  Free extent_space
 
225
0          2          2             32768              32768                 1048576       1044440
 
226
1          4          4             32768              32768                 1048576       1044400
 
227
NDBT_ProgramExit: 0 \- OK
 
228
.fi
 
229
.if n \{\
 
230
.RE
 
231
.\}
 
232
.PP
 
233
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
 
234
Free extent_space
 
235
is available for storing on\-disk column data from the
 
236
fish
 
237
table only; for this reason, it is not visible when selecting from the
 
238
INFORMATION_SCHEMA\&.FILES
 
239
table\&.
 
240
          Additional Options
 
241
.sp
 
242
.RS 4
 
243
.ie n \{\
 
244
\h'-04'\(bu\h'+03'\c
 
245
.\}
 
246
.el \{\
 
247
.sp -1
 
248
.IP \(bu 2.3
 
249
.\}
 
250
.\" ndb_desc: extra-partition-info option
 
251
.\" extra-partition-info option: ndb_desc
 
252
\fB\-\-extra\-partition\-info\fR,
 
253
\fB\-p\fR
 
254
.sp
 
255
Print additional information about the table\'s partitions\&.
 
256
.RE
 
257
.sp
 
258
.RS 4
 
259
.ie n \{\
 
260
\h'-04'\(bu\h'+03'\c
 
261
.\}
 
262
.el \{\
 
263
.sp -1
 
264
.IP \(bu 2.3
 
265
.\}
 
266
.\" ndb_desc: blob-info option
 
267
.\" blob-info option: ndb_desc
 
268
\fB\-\-blob\-info\fR,
 
269
\fB\-b\fR
 
270
.sp
 
271
Include information about subordinate
 
272
BLOB
 
273
and
 
274
TEXT
 
275
columns\&.
 
276
.sp
 
277
Use of this option also requires the use of the
 
278
\fB\-\-extra\-partition\-info\fR
 
279
(\fB\-p\fR) option\&.
 
280
.sp
 
281
This option was added in MySQL Cluster NDB 6\&.3\&.32, MySQL Cluster NDB 7\&.0\&.13, and MySQL Cluster NDB 7\&.1\&.2\&.
 
282
.RE
 
283
.sp
 
284
.RS 4
 
285
.ie n \{\
 
286
\h'-04'\(bu\h'+03'\c
 
287
.\}
 
288
.el \{\
 
289
.sp -1
 
290
.IP \(bu 2.3
 
291
.\}
 
292
.\" ndb_desc: extra-node-info option
 
293
.\" extra-node-info option: ndb_desc
 
294
\fB\-\-extra\-node\-info\fR,
 
295
\fB\-n\fR
 
296
.sp
 
297
Include information about the mappings between table partitions and the data nodes upon which they reside\&. This information can be useful for verifying distribution awareness mechanisms and supporting more efficient application access to the data stored in MySQL Cluster\&.
 
298
.sp
 
299
Use of this option also requires the use of the
 
300
\fB\-\-extra\-partition\-info\fR
 
301
(\fB\-p\fR) option\&.
 
302
.sp
 
303
This option was added in MySQL Cluster NDB 6\&.2\&.19, MySQL Cluster NDB 6\&.3\&.33, MySQL Cluster NDB 7\&.0\&.14, and MySQL Cluster NDB 7\&.1\&.2\&.
 
304
.RE
 
305
.SH "COPYRIGHT"
 
306
.br
 
307
.PP
 
308
Copyright \(co 1997, 2011, Oracle and/or its affiliates. All rights reserved.
 
309
.PP
 
310
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.
 
311
.PP
 
312
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.
 
313
.PP
 
314
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/.
 
315
.sp
 
316
.SH "SEE ALSO"
 
317
For more information, please refer to the MySQL Reference Manual,
 
318
which may already be installed locally and which is also available
 
319
online at http://dev.mysql.com/doc/.
 
320
.SH AUTHOR
 
321
Oracle Corporation (http://dev.mysql.com/).