mysql:15935
From: Etsuo SUMIYA <Etsuo SUMIYA <sumiya-e@xxxxxxxxxx>>
Date: Tue, 19 Feb 2013 17:49:17 +0900 (LMT)
Subject: [mysql 15935] mysql-5.6.9 vs mysql-5.1.68
sumiyaといいます。 いつもありがたく、mysqlを使わせもらっています。 環境: OS: Windows server 20008 32bit mysql: mysql-5.6.10-win32.zip mysql: mysql-noinstall-5.1.68-win32.zip このたび、mysql-5.6.9を使おうとダウンロードしてセットアップしまし た。 5.1.68で使用していたqueryを5.6.9で実行したところ、時間を要したため、 調べてみました。 --- ここから create database db DEFAULT CHARSET=sjis; use db; create table t2 ( name varchar(32), tm time, v varchar(255), INDEX ix(name,tm) ) ENGINE=MyISAM DEFAULT CHARSET=sjis; insert into t2 values('n1','20:00','v1'); insert into t2 values('n1','20:01','v1'); insert into t2 values('n1','20:02','v1'); insert into t2 values('n1','20:03','v1'); insert into t2 values('n1','20:04','v1'); insert into t2 values('n1','20:05','v1'); insert into t2 values('n1','20:06','v1'); insert into t2 values('n1','20:07','v1'); insert into t2 values('n1','20:08','v1'); insert into t2 values('n1','20:09','v1'); insert into t2 values('n1','20:10','v1'); mysql-5.1.68 --- mysql> explain select name,tm,v from t2 where name='n1' and tm<='20:05:00'; +----+-------------+-------+------+---------------+------+---------+-------+------+-------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+-------+------+---------------+------+---------+-------+------+-------------+ | 1 | SIMPLE | t2 | ref | ix | ix | 67 | const | 2 | Using where | +----+-------------+-------+------+---------------+------+---------+-------+------+-------------+ 1 row in set (0.00 sec) mysql> mysql-5.6.9 --- mysql> explain select name,tm,v from t2 where name='n1' and tm<='20:05:00'; +----+-------------+-------+------+---------------+------+---------+-------+------+-----------------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+-------+------+---------------+------+---------+-------+------+-----------------------+ | 1 | SIMPLE | t2 | ref | ix | ix | 67 | const | 10 | Using index condition | +----+-------------+-------+------+---------------+------+---------+-------+------+-----------------------+ 1 row in set (0.00 sec) mysql> --- ここまで 5.1.68では、rowsが2となっておりますが、5.6.10では10となっておりま す。いかがでしょうか?
-> 15935 2013-02-19 17:49 [Etsuo SUMIYA <sumiya] mysql-5.6.9 vs mysql-5.1.68 15938 2013-02-20 23:10 ┗[とみたまさひろ <tomm] @ 15939 2013-02-21 00:19 ┗["yoku ts." <yoku0825] 15940 2013-02-21 09:51 ┗[HIRATSUKA Sadao <hir] 15943 2013-02-27 17:14 ┗[Etsuo SUMIYA <sumiya] 15944 2013-02-27 23:21 ┗["yoku ts." <yoku0825] 15946 2013-02-28 18:10 ┗[Etsuo SUMIYA <sumiya] 15947 2013-02-28 18:35 ┗["yoku ts." <yoku0825] 15948 2013-03-01 11:45 ┗["yoku ts." <yoku0825]