Slide 4
Slide 4 text
comments.product_id ʹ INDEX ΛுΔ
# MySQL
> show create table comments;
CREATE TABLE `comments` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`product_id` int(11) NOT NULL,
`user_id` int(11) NOT NULL,
`content` varchar(128) NOT NULL,
`created_at` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=200073 DEFAULT CHARSET=utf8mb4
> alter table comments add index pid_idx(product_id);