1

让我重新表述一下这个问题:

/*! */在使用单独的 INSERT 语句插入数据时,以下 SQL 文件中的行是否存在至关重要?

这是现在文件的内容:

LOCK TABLES `adv_links` WRITE;
/*!40000 ALTER TABLE `adv_links` DISABLE KEYS */;
INSERT INTO `adv_links` VALUES (13,'photoreal','http://w.otoreal.tk','',14,'something','something, something',64,0,1,1,'',0,'',1277754393,1277754393,0,0,0,'85.72.100.18',0,0,0,'');
INSERT INTO `adv_links` VALUES (4,'something cirocco', 'ttp://ww.roccoh.t/','',16,'something.','',86,0,1,1,'',0,'achille',1259843781,1259843781,2714,0,0,'91.132.75.249',0,0,0,'');
INSERT INTO `adv_links` VALUES (5,'somethingasco','htp://w.vsco.b/ge/gtpage.asp?i=0','',16,'somethingsco','sco',113,0,1,1,'',0,'achille',1259843935,1259843935,2714,0,0,'91.132.75.249',0,0,0,'');
INSERT INTO `adv_links` VALUES (6,'something','http://w.ja.b/Default.aspx','',16,'somethingaga','',62,0,1,1,'',0,'achille',1259848860,1259848860,2714,0,0,'91.132.75.249',0,0,0,'');
INSERT INTO `adv_links` VALUES (7,'something','htp://w.arkorrier.com.tr/English/AC_urun.asp?ID=ACU36#','',16,'','',90,0,1,1,'',0,'achille',1259848962,1259848962,2714,0,0,'91.132.75.249',0,0,0,'');
-- omitted
/*!40000 ALTER TABLE `adv_links` ENABLE KEYS */;
UNLOCK TABLES;

我问这个是因为当到达线时,MySQL 会按排序修复索引,但由于数据集大到足以在排序/*!40000 ALTER TABLE adv_link ENABLE KEYS */;时阻塞,所以它找不到足够的空间。tmpdir

4

1 回答 1

1

如果您不禁用并重新启用密钥,则密钥将随每个INSERT语句动态更新(就像它们通常那样)。

这不需要写入tmpdir,但速度较慢。

如果您无法增加 使用的临时空间,您可以删除这些行MySQL,但它会减慢您的导入速度。

于 2011-04-20T14:19:28.770 回答