Open d-shimizu opened 2 years ago
mysql> alter table comments add index idx_user_id (user_id);
Query OK, 0 rows affected (0.50 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysql>
mysql> explain select count(*) from comments where user_id = 123;
+----+-------------+----------+------------+------+---------------+-------------+---------+-------+------+----------+-------------+
| id | select_type | table | partitions | type | possible_keys | key | key_len | ref | rows | filtered | Extra |
+----+-------------+----------+------------+------+---------------+-------------+---------+-------+------+----------+-------------+
| 1 | SIMPLE | comments | NULL | ref | idx_user_id | idx_user_id | 4 | const | 101 | 100.00 | Using index |
+----+-------------+----------+------------+------+---------------+-------------+---------+-------+------+----------+-------------+
1 row in set, 1 warning (0.00 sec)
isucon@ip-10-128-1-252:~/private_isu.git/benchmarker$ ./bin/benchmarker -u ./userdata -t http://10.128.1.80
{"pass":true,"score":15708,"success":14409,"fail":0,"messages":[]}