Linux 学习:find命令习题
2015-09-12 15:59
232 查看
select count(1) from (
select login_id,id from PlatformPassPort where login_id like 'ab%'
) t1 inner join
pp_PlatformAccount t2 on t1.id = t2.passportId
select count(1) from PlatformPassPort t1 inner join
pp_PlatformAccount t2 on t1.id = t2.passportId
where login_id like 'ab%'
本来以为inner join先执行的话可能会导致速度变慢(测试的是160w的数据量,基本是表表的全连接) ,但是发现结果2者时间差不多,可能mysql做了优化。100条以内的数据量应该感觉不到时间。所以,我的结论是:有限条目的查询条件(尤其是单表的查询)
可以放心使用inner join -- 即使数据上百万。
select login_id,id from PlatformPassPort where login_id like 'ab%'
) t1 inner join
pp_PlatformAccount t2 on t1.id = t2.passportId
select count(1) from PlatformPassPort t1 inner join
pp_PlatformAccount t2 on t1.id = t2.passportId
where login_id like 'ab%'
本来以为inner join先执行的话可能会导致速度变慢(测试的是160w的数据量,基本是表表的全连接) ,但是发现结果2者时间差不多,可能mysql做了优化。100条以内的数据量应该感觉不到时间。所以,我的结论是:有限条目的查询条件(尤其是单表的查询)
可以放心使用inner join -- 即使数据上百万。
相关文章推荐
- linux下如何挂载光驱
- “TI门外汉”的觉醒~~
- Linux 学习:文件查找的使用
- VMWare下linux安装及中文语言包安装详细步骤
- Centos 6.x/7.x yum安装php5.6.X(最新版)
- 鸟哥的Linux私房菜5.1部分笔记:linux注销、x window与命令行模式的切换(新手接触linux)
- linux常用命令-关机重启
- linux内核中断之看门狗
- Linux内核笔记——内存管理之块内存分配
- Linux 系统安全 及 lnmp 安装
- linux 学习笔记之权限管理命令
- linux学习笔记之文件搜索命令
- linux 学习笔记之文件的压缩和解压
- linux 学习之帮助命名
- 个人学习笔记---linux原子操作的实现原理
- Linux下彻底卸载mysql数据库
- centos安装git客户端以及常用指令
- 使用iptables配置linux服务器请求转发
- linux关闭sendmail服务
- 查看Linux系统版本信息方法