Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Mysql 4.0 casual

14,666 views

Published on

Published in: Business, Technology
  • Be the first to comment

Mysql 4.0 casual

  1. 1. $ grep innodb_buffer_pool /etc/my.cnfinnodb_buffer_pool_size = 10G$ echo "show variables like innodb_buffer_pool_size" | mysql -t+-------------------------+------------+| Variable_name           | Value      |+-------------------------+------------+| innodb_buffer_pool_size | 2147483648 | = 2GB+-------------------------+------------+
  2. 2. 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 |+----+-------------+-------+------+-------+--------------------------+
  3. 3. 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)
  4. 4. my $sth = $dbh->prepare(“SELECT GET_LOCK(?,300)”);$sth->execute(q!injection”!)#110214 15:50:09 server id 53721 log_pos 803 Querythread_id=6 exec_time=0 error_code=0SET TIMESTAMP=1297666209;DO RELEASE_LOCK("injection””)

×