日期:2014-05-16 浏览次数:20795 次
mysql> insert into tt(a, b, c, d) -> values(1, 1, 1, 1), (1, 1, 1, 2), -> (1, 1, 2, 1), (1, 1, 2, 1), -> (1, 1, 2, 2), (1, 2, 1, 1), -> (1, 2, 2, 1), (1, 2, 2, 2); Query OK, 8 rows affected (0.00 sec) Records: 8 Duplicates: 0 Warnings: 0 mysql> insert into tt(a, b, c, d) -> values(1, 1, 1, 1), (1, 1, 1, 2), -> (1, 1, 2, 1), (1, 1, 2, 1), -> (1, 1, 2, 2), (1, 2, 1, 1), -> (1, 2, 2, 1), (1, 2, 2, 2); Query OK, 8 rows affected (0.00 sec) Records: 8 Duplicates: 0 Warnings: 0 mysql> explain select * from tt where a = 1; +----+-------------+-------+------+---------------+------+---------+------+------+-------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+-------+------+---------------+------+---------+------+------+-------------+ | 1 | SIMPLE | tt | ALL | ind_a | NULL | NULL | NULL | 48 | Using where | +----+-------------+-------+------+---------------+------+---------+------+------+-------------+ 1 row in set (0.00 sec) mysql>