myisam_ftdump 显示 MyISAM 表中 FULLTEXT 索引的信息。它直接读取 MyISAM 索引文件,因此必须在表所在的服务器主机上运行。在使用 myisam_ftdump 之前,如果服务器正在运行,请务必先执行 FLUSH TABLES 语句。myisam_ftdump displays information about
FULLTEXT indexes in MyISAM
tables. It reads the MyISAM index file
directly, so it must be run on the server host where the table
is located. Before using myisam_ftdump, be
sure to issue a FLUSH TABLES statement first
if the server is running.
myisam_ftdump 扫描并导出整个索引,这并不是特别快。另一方面,单词的分布变化不频繁,因此不需要经常运行。myisam_ftdump scans and dumps the entire index, which is not particularly fast. On the other hand, the distribution of words changes infrequently, so it need not be run often.
像这样调用 myisam_ftdump:Invoke myisam_ftdump like this:
myisam_ftdump [options]tbl_nameindex_num
tbl_name 参数应为 MyISAM 表的名称。您也可以通过指定其索引文件(带有 .MYI 后缀的文件)来指定表。如果您没有在表文件所在的目录中调用 myisam_ftdump,则表或索引文件名必须在其前面加上表所在数据库目录的路径名。索引号从 0 开始。The tbl_name argument should be the
name of a MyISAM table. You can also specify
a table by naming its index file (the file with the
.MYI suffix). If you do not invoke
myisam_ftdump in the directory where the
table files are located, the table or index file name must be
preceded by the path name to the table's database directory.
Index numbers begin with 0.
示例:假设 test 数据库包含一个名为 mytexttable 的表,其定义如下:Example: Suppose that the test database
contains a table named mytexttable that has
the following definition:
CREATE TABLE mytexttable ( id INT NOT NULL, txt TEXT NOT NULL, PRIMARY KEY (id), FULLTEXT (txt) ) ENGINE=MyISAM;
id 上的索引是索引 0,而 txt 上的 FULLTEXT 索引是索引 1。如果你的工作目录是 test 数据库目录,按如下方式调用 myisam_ftdump:The index on id is index 0 and the
FULLTEXT index on txt is
index 1. If your working directory is the
test database directory, invoke
myisam_ftdump as follows:
myisam_ftdump mytexttable 1
如果 test 数据库目录的路径名是 /usr/local/mysql/data/test,你也可以使用该路径名来指定表名参数。如果你没有在数据库目录中调用 myisam_ftdump,这将非常有用:If the path name to the test database
directory is /usr/local/mysql/data/test,
you can also specify the table name argument using that path
name. This is useful if you do not invoke
myisam_ftdump in the database directory:
myisam_ftdump /usr/local/mysql/data/test/mytexttable 1
您可以使用 myisam_ftdump 在类 Unix 系统上按出现频率生成索引条目列表,如下所示:You can use myisam_ftdump to generate a list of index entries in order of frequency of occurrence like this on Unix-like systems:
myisam_ftdump -c mytexttable 1 | sort -r
在 Windows 上,使用:On Windows, use:
myisam_ftdump -c mytexttable 1 | sort /R
myisam_ftdump 支持以下选项:myisam_ftdump supports the following options:
--help,-h-?命令行格式Command-Line Format --help--help显示帮助信息并退出。Display a help message and exit.
--count,-c命令行格式Command-Line Format --count计算每个单词的统计数据(数量和全局权重)。Calculate per-word statistics (counts and global weights).
--dump,-d命令行格式Command-Line Format --dump转储索引,包括数据偏移量和词权重。Dump the index, including data offsets and word weights.
--length,-l命令行格式Command-Line Format --length报告长度分布。Report the length distribution.
--stats,-s命令行格式Command-Line Format --stats报告全球索引统计。如果未指定其他操作,这是默认操作。Report global index statistics. This is the default operation if no other operation is specified.
命令行格式Command-Line Format --verbose--verbose详细模式。打印更多关于程序执行内容的输出。Verbose mode. Print more output about what the program does.