还是mysql设置或是mysql版本有问题?测试的版本是mysql3.23.58。因为听说mysql3比4和5要稳定一些。
解决方案 »
- 我安装了nginx1.1.12和php5.3.5但是有phpinfo查看时,发现没有加载配置文件php.ini,实际上我这配置文件是存在信息显示的路径里面。
- 初学PHP上传文件遇到问题
- 问一个关于session的问题,急急。。。。
- 新手php 提问。
- 请问带有html代码的变量通过函数参数的形式传入的函数内部使用时,会不会有什么变化
- PHP登陆的问题
- @unset($temp);为何提示parse error, unexpected T_UNSET?
- 问题!!
- 关于网站的发布(高分相送)
- strspn(找出某字符串落在另一字符串遮罩的数目)函数的的问题。
- 请教达人,在一个日志文件中,如何统计出url出现次数最多的前5个
- 求助数据库函数的使用问题
m.showemail, mf.nickname, mf.site, mf.location FROM cdb_members m
LEFT JOIN cdb_memberfields mf USING(uid) ORDER BY uid LIMIT 0, 25;
-----------------------and
-----------------------SELECT m.uid, m.username, m.gender, m.email, m.regdate, m.lastvisit, m.posts, m.credits, m.showemail FROM cdb_members m order by m.uid LIMIT 0, 25;SELECT mf.uid,mf.nickname, mf.site, mf.location FROM cdb_memberfields mf ORDER BY mf.uid LIMIT 0, 25;
-----------------------They are not the same. They won't return the same result.
m.showemail, mf.nickname, mf.site, mf.location FROM cdb_members m
LEFT JOIN cdb_memberfields mf USING(uid) ORDER BY uid -----------------------------
It will return all the data from the first table (cdb_members), and the data from the second table (cdb_memberfields) which the uid of it also exists in the first table (cdb_members).
How much time you spend to combine the two results ?
ob_start();
microtime();
执行sql
比较microtime();
显示执行时间经过测试,不论是分成2条,还是直接把order by 去掉都是执行0.003秒。但原样执行就是1秒左右。explain的结果table m mf
type index eq_ref
possible_keys NULL primary
key primary primary
key_len 3 3
ref NULL m.uid
rows 173378 1
Extra NULL NULL原样执行时间1秒左右。去掉order by后,table m的type变成all,这时执行时间只要0.003秒。