从[Table1](原始表)创建副本后,我注意到新表[Table2]比原始表大得多。请查看下面的屏幕截图和结构:
$stmt = $this->db->prepare('SELECT * FROM DOC_Documents WHERE DOC_ID = ?');
$stmt->execute([$docID]);
$document = $stmt->fetch();
$filename = str_replace(' ', '', $document['DOC_Name']);
$filename .= '.';
$filename .= $document['DOC_Extension'];
header($_SERVER["SERVER_PROTOCOL"] . " 200 OK");
header('Content-Description: File Transfer');
header("Content-Type: " . $document["DOC_Type"]);
header("Content-Disposition: attachment; filename=" . $filename);
readfile(trim($document['DOC_File']));
CREATE TABLE 'Table1'
'A' int(11) NOT NULL AUTO_INCREMENT,
'B' int(6) NOT NULL,
'C' varchar(32) DEFAULT NULL,
'D' text,
'E' varchar(15) DEFAULT NULL,
'F'set('UNKNOWN','ZZZ','YYY','XXX','WWW','VVV','UUU','TTT','SSS','RRR') NOT NULL,
'G' date NOT NULL,
'H' date DEFAULT NULL,
'sent_F' date DEFAULT NULL,
PRIMARY KEY ('A'),
UNIQUE KEY 'unique_C' ('C','G'),
KEY 'B' ('B'),
KEY 'F' ('F'),
KEY 'G' ('G'),
KEY 'sent_F' ('sent_F'),
KEY 'H' ('H'),
KEY 'C' ('C')
) ENGINE=InnoDB AUTO_INCREMENT=31251953 DEFAULT CHARSET=latin1
我执行重复[Table1]的方式:
CREATE TABLE 'Table2'
'A' int(11) NOT NULL AUTO_INCREMENT,
'B' int(6) NOT NULL,
'C' varchar(32) DEFAULT NULL,
'D' text,
'E' varchar(15) DEFAULT NULL,
'F'set('UNKNOWN','ZZZ','YYY','XXX','WWW','VVV','UUU','TTT','SSS','RRR') NOT NULL,
'G' date NOT NULL,
'H' date DEFAULT NULL,
'sent_F' date DEFAULT NULL,
PRIMARY KEY ('A'),
UNIQUE KEY 'unique_C' ('C','G'),
KEY 'B' ('B'),
KEY 'F' ('F'),
KEY 'G' ('G'),
KEY 'sent_F' ('sent_F'),
KEY 'H' ('H'),
KEY 'C' ('C')
) ENGINE=InnoDB AUTO_INCREMENT=31171617 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT
这两种表都包含相同的数据,并且配置了相同的规则。
谁能解释复制的表为什么比原始表大得多?有场面吗? 2GB到6GB?