ndb_index_stat ...
To obtain basic index statistics about a given
NDB table, invoke
ndb_index_stat as shown here, with the name
of the table as the first argument and the name of the database
containing this table specified immediately following it, using
the --database
(-d) option:
ndb_index_stattable-ddatabase
In this example, we use ndb_index_stat to
obtain such information about an NDB table
named mytable in the test
database:
shell> ndb_index_stat -d test mytable
table:mytable index:PRIMARY fragCount:4
sampleVersion:2 loadTime:1336751773 sampleCount:0 keyBytes:0
query cache: valid:1 sampleCount:0 totalBytes:0
times in ms: save: 12.380 sort: 0.001
NDBT_ProgramExit: 0 - OK
The --verbose option
provides some additional output, as shown here:
shell> ndb_index_stat -d test mytable --verbose
random seed 1337010518
connected
loop 1 of 1
table:mytable index:PRIMARY fragCount:4
sampleVersion:2 loadTime:1336751773 sampleCount:0 keyBytes:0
read stats
query cache created
query cache: valid:1 sampleCount:0 totalBytes:0
times in ms: save: 20.766 sort: 0.001
disconnected
NDBT_ProgramExit: 0 - OK
shell>
The following table includes options that are specific to the MySQL Cluster ndb_index_stat utility. Additional descriptions are listed following the table. For options common to most MySQL Cluster programs (including ndb_index_stat), see Section 17.4.24, “Options Common to MySQL Cluster Programs — Options Common to MySQL Cluster Programs”.
Table 17.20. ndb_index_stat Options and Variables: MySQL Cluster NDB 7.2
| Format | Description | Added / Removed |
|---|---|---|
| Name of the database containing the table. | All MySQL 5.5 based releases |
| Delete index statistics for the given table, stopping any auto-update previously configured. | All MySQL 5.5 based releases |
| Update index statistics for the given table, restarting any auto-update previously configured. | All MySQL 5.5 based releases |
| Print the query cache. | All MySQL 5.5 based releases |
| Perform a number of random range queries on first key attr (must be int unsigned). | All MySQL 5.5 based releases |
| Drop any statistics tables and events in NDB kernel (all statistics are lost) | All MySQL 5.5 based releases |
| Create all statistics tables and events in NDB kernel, if none of them already exist | All MySQL 5.5 based releases |
| Create any statistics tables and events in NDB kernel that do not already exist. | All MySQL 5.5 based releases |
| Create any statistics tables or events that do not already exist in the NDB kernel. after dropping any that are invalid. | All MySQL 5.5 based releases |
| Verify that NDB system index statistics and event tables exist. | All MySQL 5.5 based releases |
| Do not apply sys-* options to tables. | All MySQL 5.5 based releases |
| Do not apply sys-* options to events. | All MySQL 5.5 based releases |
| Turn on verbose output | All MySQL 5.5 based releases |
| Set the number of times to perform a given command. Default is 0. | All MySQL 5.5 based releases |
ndb_index_stat statistics options. The following options are used to generate index statistics. They work with a given table and database. They cannot be mixed with ndb_index_stat system options.
| Command-Line Format | --database=name | ||
-d | |||
| Permitted Values | |||
| Type | string | ||
| Default | [none] | ||
| Range | .. | ||
The name of the database that contains the table being queried.
| Command-Line Format | --delete | ||
| Permitted Values | |||
| Type | boolean | ||
| Default | true | ||
| Range | .. | ||
Delete the index statistics for the given table, stopping any auto-update that was previously configured.
| Command-Line Format | --update | ||
| Permitted Values | |||
| Type | boolean | ||
| Default | true | ||
| Range | .. | ||
Update the index statistics for the given table, and restart any auto-update that previously configured.
| Command-Line Format | --dump | ||
| Permitted Values | |||
| Type | boolean | ||
| Default | true | ||
| Range | .. | ||
Dump the contents of the query cache.
| Command-Line Format | --query=# | ||
| Permitted Values | |||
| Type | numeric | ||
| Default | 0 | ||
| Range | 0 .. MAX_INT | ||
Perform random range queries on first key attribute (must be int unsigned).
ndb_index_stat system options. The following options are used to generate and update the statistics tables in the NDB kernel. They cannot be mixed with ndb_index_stat statistics options.
| Command-Line Format | --sys-drop | ||
| Permitted Values | |||
| Type | boolean | ||
| Default | true | ||
| Range | .. | ||
Drop all statistics tables and events in the NDB kernel. This causes all statistics to be lost.
| Command-Line Format | --sys-create | ||
| Permitted Values | |||
| Type | boolean | ||
| Default | true | ||
| Range | .. | ||
Create all statistics tables and events in the NDB kernel. This works only if none of them exist previously.
| Command-Line Format | --sys-create-if-not-exist | ||
| Permitted Values | |||
| Type | boolean | ||
| Default | true | ||
| Range | .. | ||
Create any NDB system statistics tables or events (or both) that do not already exist when the program is invoked.
| Command-Line Format | --sys-create-if-not-valid | ||
| Permitted Values | |||
| Type | boolean | ||
| Default | true | ||
| Range | .. | ||
Create any NDB system statistics tables or events that do not already exist, after dropping any that are invalid.
| Command-Line Format | --sys-check | ||
| Permitted Values | |||
| Type | boolean | ||
| Default | true | ||
| Range | .. | ||
Verify that all required system statistics tables and events exist in the NDB kernel.
| Command-Line Format | --sys-skip-tables | ||
| Permitted Values | |||
| Type | boolean | ||
| Default | true | ||
| Range | .. | ||
Do not apply any --sys-* options to any
statistics tables.
| Command-Line Format | --sys-skip-events | ||
| Permitted Values | |||
| Type | boolean | ||
| Default | true | ||
| Range | .. | ||
Do not apply any --sys-* options to any
events.
| Command-Line Format | --verbose | ||
-v | |||
| Permitted Values | |||
| Type | boolean | ||
| Default | true | ||
| Range | .. | ||
Turn on verbose output.
| Command-Line Format | --loops=# | ||
| Permitted Values | |||
| Type | numeric | ||
| Default | 0 | ||
| Range | 0 .. MAX_INT | ||
Repeat commands this number of times (for use in testing).