1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590
|
'\" t
.\" Title: \fBndb_desc\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.77.1 <http://docbook.sf.net/>
.\" Date: 11/04/2013
.\" Manual: MySQL Database System
.\" Source: MySQL 5.1
.\" Language: English
.\"
.TH "\FBNDB_DESC\FR" "1" "11/04/2013" "MySQL 5\&.1" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.\" ndb_desc
.SH "NAME"
ndb_desc \- describe NDB tables
.SH "SYNOPSIS"
.HP \w'\fBndb_desc\ \fR\fB\fIoptions\fR\fR\ 'u
\fBndb_desc \fR\fB\fIoptions\fR\fR
.SH "DESCRIPTION"
.PP
\fBndb_desc\fR
provides a detailed description of one or more
NDB
tables\&.
Usage
.sp
.if n \{\
.RS 4
.\}
.nf
ndb_desc \-c \fIconnect_string\fR \fItbl_name\fR \-d \fIdb_name\fR [\-p]
.fi
.if n \{\
.RE
.\}
.PP
(\fIMySQL Cluster NDB 7\&.0\&.36 and later; MySQL Cluster NDB 7\&.1\&.25 and later:\fR)
.sp
.if n \{\
.RS 4
.\}
.nf
ndb_desc \-c \fIconnect_string\fR \fIindex_name\fR \-d \fIdb_name\fR \-t \fItbl_name\fR
.fi
.if n \{\
.RE
.\}
.sp
Sample Output
.PP
MySQL table creation and population statements:
.sp
.if n \{\
.RS 4
.\}
.nf
USE test;
CREATE TABLE fish (
id INT(11) NOT NULL AUTO_INCREMENT,
name VARCHAR(20) NOT NULL,
length_mm INT(11) NOT NULL,
weight_gm INT(11) NOT NULL,
PRIMARY KEY pk (id),
UNIQUE KEY uk (name)
) ENGINE=NDB;
INSERT INTO fish VALUES
(\*(Aq\*(Aq,\*(Aqguppy\*(Aq, 35, 2), (\*(Aq\*(Aq,\*(Aqtuna\*(Aq, 2500, 150000),
(\*(Aq\*(Aq,\*(Aqshark\*(Aq, 3000, 110000), (\*(Aq\*(Aq,\*(Aqmanta ray\*(Aq, 1500, 50000),
(\*(Aq\*(Aq,\*(Aqgrouper\*(Aq, 900, 125000), (\*(Aq\*(Aq,\*(Aqpuffer\*(Aq, 250, 2500);
.fi
.if n \{\
.RE
.\}
.PP
Output from
\fBndb_desc\fR:
.sp
.if n \{\
.RS 4
.\}
.nf
shell> \fB\&./ndb_desc \-c localhost fish \-d test \-p\fR
\-\- fish \-\-
Version: 2
Fragment type: 9
K Value: 6
Min load factor: 78
Max load factor: 80
Temporary table: no
Number of attributes: 4
Number of primary keys: 1
Length of frm data: 311
Row Checksum: 1
Row GCI: 1
SingleUserMode: 0
ForceVarPart: 1
FragmentCount: 2
TableStatus: Retrieved
\-\- Attributes \-\-
id Int PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY AUTO_INCR
name Varchar(20;latin1_swedish_ci) NOT NULL AT=SHORT_VAR ST=MEMORY
length_mm Int NOT NULL AT=FIXED ST=MEMORY
weight_gm Int NOT NULL AT=FIXED ST=MEMORY
\-\- Indexes \-\-
PRIMARY KEY(id) \- UniqueHashIndex
PRIMARY(id) \- OrderedIndex
uk$unique(name) \- UniqueHashIndex
uk(name) \- OrderedIndex
\-\- Per partition info \-\-
Partition Row count Commit count Frag fixed memory \&.\&.\&.
0 2 2 32768 \&.\&.\&.
1 4 4 32768 \&.\&.\&.
\&.\&.\&. Frag varsized memory Extent_space Free extent_space
\&.\&.\&. 32768 0 0
\&.\&.\&. 32768 0 0
NDBT_ProgramExit: 0 \- OK
.fi
.if n \{\
.RE
.\}
.PP
Information about multiple tables can be obtained in a single invocation of
\fBndb_desc\fR
by using their names, separated by spaces\&. All of the tables must be in the same database\&.
.PP
Beginning with MySQL Cluster NDB 7\&.0\&.36 and MySQL Cluster NDB 7\&.1\&.25, it is possible to obtain additional information about a specific index using the
\fB\-\-table\fR
(short form:
\fB\-t\fR) option introduced in these versions and supplying the name of the index as the first argument to
\fBndb_desc\fR, as shown here:
.sp
.if n \{\
.RS 4
.\}
.nf
shell> \fB\&./ndb_desc uk \-d test \-t fish\fR
\-\- uk \-\-
Version: 3
Base table: fish
Number of attributes: 1
Logging: 0
Index type: OrderedIndex
Index status: Retrieved
\-\- Attributes \-\-
name Varchar(20;latin1_swedish_ci) NOT NULL AT=SHORT_VAR ST=MEMORY
\-\- IndexTable 10/uk \-\-
Version: 3
Fragment type: FragUndefined
K Value: 6
Min load factor: 78
Max load factor: 80
Temporary table: yes
Number of attributes: 2
Number of primary keys: 1
Length of frm data: 0
Row Checksum: 1
Row GCI: 1
SingleUserMode: 2
ForceVarPart: 0
FragmentCount: 4
ExtraRowGciBits: 0
ExtraRowAuthorBits: 0
TableStatus: Retrieved
\-\- Attributes \-\-
name Varchar(20;latin1_swedish_ci) NOT NULL AT=SHORT_VAR ST=MEMORY
NDB$TNODE Unsigned [64] PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY
\-\- Indexes \-\-
PRIMARY KEY(NDB$TNODE) \- UniqueHashIndex
NDBT_ProgramExit: 0 \- OK
.fi
.if n \{\
.RE
.\}
.PP
When an index is specified in this way, the
\fB\-\-extra\-partition\-info\fR
and
\fB\-\-extra\-node\-info\fR
options have no effect\&.
.PP
The
Version
column in the output contains the table\*(Aqs schema object version\&. For information about interpreting this value, see
\m[blue]\fBNDB Schema Object Versions\fR\m[]\&\s-2\u[1]\d\s+2\&.
.PP
The
Extent_space
and
Free extent_space
columns were added in MySQL Cluster NDB 6\&.3\&.27 and MySQL Cluster NDB 7\&.0\&.8\&. They are applicable only to
NDB
tables having columns on disk; for tables having only in\-memory columns, these columns always contain the value
0\&.
.PP
To illustrate their use, we modify the previous example\&. First, we must create the necessary Disk Data objects, as shown here:
.sp
.if n \{\
.RS 4
.\}
.nf
CREATE LOGFILE GROUP lg_1
ADD UNDOFILE \*(Aqundo_1\&.log\*(Aq
INITIAL_SIZE 16M
UNDO_BUFFER_SIZE 2M
ENGINE NDB;
ALTER LOGFILE GROUP lg_1
ADD UNDOFILE \*(Aqundo_2\&.log\*(Aq
INITIAL_SIZE 12M
ENGINE NDB;
CREATE TABLESPACE ts_1
ADD DATAFILE \*(Aqdata_1\&.dat\*(Aq
USE LOGFILE GROUP lg_1
INITIAL_SIZE 32M
ENGINE NDB;
ALTER TABLESPACE ts_1
ADD DATAFILE \*(Aqdata_2\&.dat\*(Aq
INITIAL_SIZE 48M
ENGINE NDB;
.fi
.if n \{\
.RE
.\}
.PP
(For more information on the statements just shown and the objects created by them, see
Section\ \&17.5.12.1, \(lqMySQL Cluster Disk Data Objects\(rq, as well as
Section\ \&13.1.14, \(lqCREATE LOGFILE GROUP Syntax\(rq, and
Section\ \&13.1.18, \(lqCREATE TABLESPACE Syntax\(rq\&.)
.PP
Now we can create and populate a version of the
fish
table that stores 2 of its columns on disk (deleting the previous version of the table first, if it already exists):
.sp
.if n \{\
.RS 4
.\}
.nf
CREATE TABLE fish (
id INT(11) NOT NULL AUTO_INCREMENT,
name VARCHAR(20) NOT NULL,
length_mm INT(11) NOT NULL,
weight_gm INT(11) NOT NULL,
PRIMARY KEY pk (id),
UNIQUE KEY uk (name)
) TABLESPACE ts_1 STORAGE DISK
ENGINE=NDB;
INSERT INTO fish VALUES
(\*(Aq\*(Aq,\*(Aqguppy\*(Aq, 35, 2), (\*(Aq\*(Aq,\*(Aqtuna\*(Aq, 2500, 150000),
(\*(Aq\*(Aq,\*(Aqshark\*(Aq, 3000, 110000), (\*(Aq\*(Aq,\*(Aqmanta ray\*(Aq, 1500, 50000),
(\*(Aq\*(Aq,\*(Aqgrouper\*(Aq, 900, 125000), (\*(Aq\*(Aq,\*(Aqpuffer\*(Aq, 250, 2500);
.fi
.if n \{\
.RE
.\}
.PP
When run against this version of the table,
\fBndb_desc\fR
displays the following output:
.sp
.if n \{\
.RS 4
.\}
.nf
shell> \fB\&./ndb_desc \-c localhost fish \-d test \-p\fR
\-\- fish \-\-
Version: 3
Fragment type: 9
K Value: 6
Min load factor: 78
Max load factor: 80
Temporary table: no
Number of attributes: 4
Number of primary keys: 1
Length of frm data: 321
Row Checksum: 1
Row GCI: 1
SingleUserMode: 0
ForceVarPart: 1
FragmentCount: 2
TableStatus: Retrieved
\-\- Attributes \-\-
id Int PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY AUTO_INCR
name Varchar(20;latin1_swedish_ci) NOT NULL AT=SHORT_VAR ST=MEMORY
length_mm Int NOT NULL AT=FIXED ST=DISK
weight_gm Int NOT NULL AT=FIXED ST=DISK
\-\- Indexes \-\-
PRIMARY KEY(id) \- UniqueHashIndex
PRIMARY(id) \- OrderedIndex
uk$unique(name) \- UniqueHashIndex
uk(name) \- OrderedIndex
\-\- Per partition info \-\-
Partition Row count Commit count Frag fixed memory \&.\&.\&.
0 2 2 32768 \&.\&.\&.
1 4 4 32768 \&.\&.\&.
\&.\&.\&. Frag varsized memory Extent_space Free extent_space
\&.\&.\&. 32768 0 0
\&.\&.\&. 32768 0 0
NDBT_ProgramExit: 0 \- OK
.fi
.if n \{\
.RE
.\}
.PP
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\*(Aqs disk\-based columns\&. The number of bytes shown as
Free extent_space
is available for storing on\-disk column data from the
fish
table only; for this reason, it is not visible when selecting from the
INFORMATION_SCHEMA\&.FILES
table\&.
.PP
The following table includes options that are specific to
\fBndb_desc\fR\&. Additional descriptions follow the table\&. For options common to most MySQL Cluster programs (including
\fBndb_desc\fR), see
Options Common to MySQL Cluster Programs(1)\&.
.sp
.it 1 an-trap
.nr an-no-space-flag 1
.nr an-break-flag 1
.br
.B Table\ \&17.17.\ \&ndb_desc Options and Variables: MySQL 5.1, MySQL Cluster NDB 6.3-7.1
.TS
allbox tab(:);
lB lB lB.
T{
Format
T}:T{
Description
T}:T{
Added / Removed
T}
.T&
l l l
l l l
l l l
l l l
l l l
l l l
l l l.
T{
.PP
--blob-info,
.PP
-b
T}:T{
Include partition information for BLOB tables in output\&. Requires that
the \-p option also be used
T}:T{
.PP
ADDED: NDB 6\&.3\&.32, NDB 7\&.0\&.13, NDB 7\&.1\&.2
T}
T{
.PP
--database=dbname,
.PP
-d
T}:T{
Name of database containing table
T}:T{
.PP
All MySQL 5\&.1 based releases
T}
T{
.PP
--extra-node-info,
.PP
-n
T}:T{
Include partition\-to\-data\-node mappings in output\&. Requires that the \-p
option also be used
T}:T{
.PP
ADDED: NDB 6\&.2\&.19, NDB 6\&.3\&.33, NDB 7\&.0\&.14, NDB 7\&.1\&.2
T}
T{
.PP
--extra-partition-info,
.PP
-p
T}:T{
Display information about partitions
T}:T{
.PP
All MySQL 5\&.1 based releases
T}
T{
.PP
--retries=#,
.PP
-r
T}:T{
Number of times to retry the connection (once per second)
T}:T{
.PP
All MySQL 5\&.1 based releases
T}
T{
.PP
--table=tbl_name,
.PP
-t
T}:T{
Specify the table in which to find an index\&. When this option is used,
\-p and \-n have no effect and are ignored\&.
T}:T{
.PP
ADDED: NDB 7\&.0\&.36, NDB 7\&.1\&.25
T}
T{
.PP
--unqualified,
.PP
-u
T}:T{
Use unqualified table names
T}:T{
.PP
All MySQL 5\&.1 based releases
T}
.TE
.sp 1
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
.\" ndb_desc: blob-info option
.\" blob-info option: ndb_desc
\fB\-\-blob\-info\fR,
\fB\-b\fR
.sp
Include information about subordinate
BLOB
and
TEXT
columns\&.
.sp
Use of this option also requires the use of the
\fB\-\-extra\-partition\-info\fR
(\fB\-p\fR) option\&.
.sp
This option was added in MySQL Cluster NDB 6\&.3\&.32, MySQL Cluster NDB 7\&.0\&.13, and MySQL Cluster NDB 7\&.1\&.2\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
.\" ndb_desc: database option
.\" database option: ndb_desc
\fB\-\-database=\fR\fB\fIdb_name\fR\fR,
\fB\-d\fR
.sp
Specify the database in which the table should be found\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
.\" ndb_desc: extra-node-info option
.\" extra-node-info option: ndb_desc
\fB\-\-extra\-node\-info\fR,
\fB\-n\fR
.sp
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\&.
.sp
Use of this option also requires the use of the
\fB\-\-extra\-partition\-info\fR
(\fB\-p\fR) option\&.
.sp
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\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
.\" ndb_desc: extra-partition-info option
.\" extra-partition-info option: ndb_desc
\fB\-\-extra\-partition\-info\fR,
\fB\-p\fR
.sp
Print additional information about the table\*(Aqs partitions\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
.\" ndb_desc: retries option
.\" retries option: ndb_desc
\fB\-\-retries=\fR\fB\fI#\fR\fR,
\fB\-r\fR
.sp
Try to connect this many times before giving up\&. One connect attempt is made per second\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
.\" ndb_desc: table option
.\" table option: ndb_desc
\fB\-\-table=\fR\fB\fItbl_name\fR\fR,
\fB\-t\fR
.sp
Specify the table in which to look for an index\&.
.sp
This option was added in MySQL Cluster NDB 7\&.0\&.36 and MySQL Cluster NDB 7\&.1\&.25\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
.\" ndb_desc: unqualified option
.\" unqualified option: ndb_desc
\fB\-\-unqualified\fR,
\fB\-u\fR
.sp
Use unqualified table names\&.
.RE
.SH "COPYRIGHT"
.br
.PP
Copyright \(co 1997, 2013, Oracle and/or its affiliates. All rights reserved.
.PP
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.
.PP
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.
.PP
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/.
.sp
.SH "NOTES"
.IP " 1." 4
NDB Schema Object Versions
.RS 4
\%http://dev.mysql.com/doc/ndbapi/en/ndb-internals-schema-object-versions.html
.RE
.SH "SEE ALSO"
For more information, please refer to the MySQL Reference Manual,
which may already be installed locally and which is also available
online at http://dev.mysql.com/doc/.
.SH AUTHOR
Oracle Corporation (http://dev.mysql.com/).
|