14. CREATE TABLE hoge (
id int unsigned NOT NULL auto_increment primary key,
level tinyint NOT NULL default '1',
KEY level (level)
) Engine=InnoDB;
mysql> explain select id from hoge where level=2 order by id;
+----+-------------+-------+------+-------+--------------------------+
| id | select_type | table | type | key | Extra |
+----+-------------+-------+------+-------+--------------------------+
| 1 | SIMPLE | hoge | ref | level | Using where; Using index |
+----+-------------+-------+------+-------+--------------------------+
15. mysql> select version();
| 4.0.27-log |
mysql> explain select id from hoge where level=2 order by id;
+-------+------+-------+------------------------------------------+
| table | type | key | Extra |
+-------+------+-------+------------------------------------------+
| hoge | ref | level | Using where; Using index; Using filesort |
+-------+------+-------+------------------------------------------+
1 row in set (0.00 sec)
16.
17.
18.
19.
20.
21. my $sth = $dbh->prepare(“SELECT GET_LOCK(?,300)”);
$sth->execute(q!injection”!)
#110214 15:50:09 server id 53721 log_pos 803 Query
thread_id=6 exec_time=0 error_code=0
SET TIMESTAMP=1297666209;
DO RELEASE_LOCK("injection””)