mysql order by/group by 优化
explain select im.item_id from property_value p left join item i on p.id = i.value left join
item_message im on i.item_id = im.item_id where ( p.value like '%餐饮%' or p.value like '%拉%' ) and im.class = 1 and im.status = 0 and p.`property_id` in (SELECT id from
`property` WHERE `key_p` = 1) LIMIT 24 , 8
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY im ref class,item_id class 4 const 9096 Using where
1 PRIMARY i ref value,item_id item_id 4 fenlei.im.item_id 8 Using where
1 PRIMARY p eq_ref PRIMARY PRIMARY 4 fenlei.i.value 1 Using where
2 DEPENDENT SUBQUERY property unique_subquery PRIMARY PRIMARY 4 func 1 Using where
explain select count(im.item_id), im.item_id from property_value p left join item i on p.id = i.value left join
item_message im on i.item_id = im.item_id where ( p.value like '%餐饮%' or p.value like '%拉%' ) and im.class = 1 and im.status = 0 and p.`property_id` in (SELECT id from
`property` WHERE `key_p` = 1) group by im.item_id LIMIT 20 , 8
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY im index class,item_id item_id 4 NULL 3 Using where
1 PRIMARY i ref value,item_id item_id 4 fenlei.im.item_id 8 Us
相关问答:
我是用mysql自带的C API
if(mysql_real_connect(&mysql,"125.0.0.108","root","root","home",3306,NULL,0))
{
AfxMessageBox("数据库连接失败") ......
大家好:
我是搞C的, 现在想用C 连接MYSQL,但是怎么也连接不了,我的代码如下:
#include <stdio.h>
#include "C:\Program Files\MySQL\MySQL Server 5.0\include\mysql.h"
......
在安装Java编译器的Eclipse的时候,对环境变量进行了配置,在安装MySQl的时候也要对环境变量进行配置;那么后面的配置会影响前面的Eclipse的配置吗?
请大家多指教~!谢谢!
不会把,我这都装了的 我系统里 还装了 ......
这个视频讲的很详细, 对新手非常有用, 基本上一看就懂
由于太大了(50m, 我只能上传20m), 我上传不了, 只好贴出下载地址
下载地址: http://ftel1.3800hk.com/0807/080720djxnzj.rar
好东西,下个看看
......
mysql>create book(
->id varchar(20) not null,g
->
以上是在mysql命令行里的操作
在上面中我在倒数第二行多打了一个字母g然后按了回车键,请问从倒数第一行怎么 ......