不知道是不是自己太弱了~~对Mysql彻底失望拉~100w数据有索引,检索竟然要1分钟~ SQL如下:SELECT mv from hb2 where mv = '04b51c24193198af023fe14c22cf53cfc9409c35c5e44e8b'其中mv建立了索引~hb2大约数据量为100w~执行上面的Sql竟然耗时1秒钟,这实在无法满足需求! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <img src="http://i.imgur.com/o72zb.jpg" title="Hosted by imgur.com" /> 上面是explain的结果啊,麻烦大家看看阿~ 贴出 show index from hb2 ;以文本方式贴出,不要贴图。mysql> show index from wsz2;+-------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+| Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment |+-------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+| wsz2 | 0 | PRIMARY | 1 | id | A | 5 | NULL | NULL | | BTREE | | || wsz2 | 1 | name | 1 | name | A | 5 | NULL | NULL | | BTREE | | || wsz2 | 1 | name | 2 | time | A | 5 | NULL | NULL | | BTREE | | |+-------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+3 rows in set (0.55 sec)mysql> 没用到索引啊show create table tbname看看你有索引吗 确定HB2中MV上有索引?检查一下 show index from HB2贴结果 MYSQL的目标不就是要做到尽快查询吗?你的where 用了什么过滤的?非索引字段? Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment都是空的好像是没索引可是我明明在程序里建了阿 String i1 = "CREATE INDEX index_mv ON " + tName + " (mv)"; 在MYSQL中再建立一下显示i1中的内容出来看看 Mysql的一些初级问题! 导入大量数据的问题 my sql连接jsp界面 MySQL中,DatabaseMetaData.getTables方法返回的ResultSet中的第二个字段均为空,是否一定是这样的? 数据库问题,救命。 txt文件导入到mysql postgres里面什么sql语句能查出表结构? 请问各位的mysql用的JDBC是哪下的,怎么才能正确加载啊,为什么我在mysql网站下的JDBC不好用啊,是不是加载错了?? jsp中的中文问题 求解决,把多情况update合并成一个 自定义函数问题 连接数据库
+-------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment |
+-------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| wsz2 | 0 | PRIMARY | 1 | id | A | 5 | NULL | NULL | | BTREE | | |
| wsz2 | 1 | name | 1 | name | A | 5 | NULL | NULL | | BTREE | | |
| wsz2 | 1 | name | 2 | time | A | 5 | NULL | NULL | | BTREE | | |
+-------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
3 rows in set (0.55 sec)mysql>
show create table tbname看看你有索引吗
show index from HB2
贴结果
你的where 用了什么过滤的?非索引字段?
都是空的好像是没索引可是我明明在程序里建了阿
String i1 = "CREATE INDEX index_mv ON " + tName + " (mv)";
显示i1中的内容出来看看