我enwiki-latest-pagelinks.sql.gz从dumps.wikimedia.org/enwiki/latest/.
我对文件进行了压缩,其未压缩大小为 37G。
表结构是这样的:
SHOW CREATE TABLE wp_dump.pagelinks;
CREATE TABLE `pagelinks` (
`pl_from` int(8) unsigned NOT NULL DEFAULT '0',
`pl_namespace` int(11) NOT NULL DEFAULT '0',
`pl_title` varbinary(255) NOT NULL DEFAULT '',
`pl_from_namespace` int(11) NOT NULL DEFAULT '0',
UNIQUE KEY `pl_from` (`pl_from`,`pl_namespace`,`pl_title`),
KEY `pl_namespace` (`pl_namespace`,`pl_title`,`pl_from`),
KEY `pl_backlinks_namespace` (`pl_from_namespace`,`pl_namespace`,`pl_title`,`pl_from`)
) ENGINE=InnoDB DEFAULT CHARSET=binary
Run Code Online (Sandbox Code Playgroud)
我将该表导入到一个新的空数据库中:
mysql -D wp_dump -u root -p < enwiki-latest-pagelinks.sql
Run Code Online (Sandbox Code Playgroud)
我正在运行任务的计算机有 16G 的 RAM,并且 mysql 数据库位于 SSD 上,所以我假设尽管表的大小,导入不会花费太长时间。
但是,该任务在一天后一直在运行并且仍在运行。没有其他进程访问mysql,计算机上也没有工作负载。
数据库文件本身现在有 79G 大。
ls -lh
-rw-r----- 1 …Run Code Online (Sandbox Code Playgroud)