易截截图软件、单文件、免安装、纯绿色、仅160KB

mysql 索引的使用

mysql> explain SELECT * from uchome_feed force index(uid) WHERE uid IN ('0',16,109,164,182,238,268,388,403,475);
+----+-------------+-------------+------+---------------+------+---------+------+--------+-------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+-------------+------+---------------+------+---------+------+--------+-------------+
| 1 | SIMPLE | uchome_feed | ALL | uid | NULL | NULL | NULL | 449779 | Using where |
+----+-------------+-------------+------+---------------+------+---------+------+--------+-------------+

强制使用索引居然也没用,mysql in操作难道不走索引??
该如何优化??

mysql> show index from uchome_feed;
+-------------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+
| Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment |
+-------------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+
| uchome_feed | 0 | PRIMARY | 1 | feedid | A | 449779 | NULL | NULL | | BTREE | |
| uchome_feed | 1 | uid | 1 | uid | A | 449779 |


相关问答:

mysql的连接超时时间怎么设置 - VC/MFC / 数据库

我是用mysql自带的C API
if(mysql_real_connect(&mysql,"125.0.0.108","root","root","home",3306,NULL,0))

AfxMessageBox("数据库连接失败") ......

mysql连接tomcat - Java / Web 开发

我已经按照教程上配置tomcat的server.xml
<Context path = "/POS" docBase = "POS" debug = "5" reloadable = "true" crossContext = "true" workDir = &quo ......

怎么在eclipse下向mysql插入变量啊 - Java / Java相关

String SQL="insert into 学生信息表 values(StudentNumber,StudentName,StudentAge)";其中StudentNumber,StudentName,StudentAge都是变量。这样写不对……到底该咋写啊

万分感谢!

String SQL=&q ......

mysql连接被频繁中断

100215 9:55:47 [Warning] Aborted connection 247 to db: 'gases' user: 'root' host: 'localhost' (Got an error reading communication packets)
100215 9:55:47 [Warning] Aborted connection 257 to db: 'ga ......

如何查看mysql列长度

如何用sql查看表的列长度
show create table xxx;
可以获得建表命令,再进行分析,应该能得到想要的信息


MySQL 5 以上,你可以从数据字典中查到
select TABLE_SCHEMA,TABLE_NAME,COLUMN_NAME,DATA_TYPE,CHAR ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号