CREATE TABLE IF NOT EXISTS `church` (
`church_id` INT(11) NOT NULL AUTO_INCREMENT ,
`name` VARCHAR(40) NOT NULL ,
`city_id` SMALLINT(4) UNSIGNED ZEROFILL NOT NULL ,
`validated` TINYINT(1) NULL ,
PRIMARY KEY (`church_id`) ,
INDEX `church.city_id-city.city_id_idx` (`city_id` ASC) ,
UNIQUE INDEX `church-city_id` (`name` ASC, `city_id` ASC) ,
CONSTRAINT `church.city_id-city.city_id`
FOREIGN KEY (`city_id` )
REFERENCES `city` (`city_id` )
ON DELETE RESTRICT
ON UPDATE RESTRICT)
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8
我的localhost(笔记本电脑)上有这个表church
。当我对它进行插入时(它现在有10
行),需要160毫秒。
这不是很多,而且我做错了什么?
答案 0 :(得分:3)
插入必须做很多工作: