如何让你的SQL运行得更快
select count(*) from record where date >'' and date < ''and amount >2000 (25秒)
select date ,sum(amount) from record group by date(55秒)
select count(*) from record where date >'' and place in ('BJ','SH') (27秒)
select count(*) from record where date >'' and date < '' and amount >2000 (14秒)
select date,sum(amount) from record group by date(28秒)
select count(*) from record where date >'' and place in ('BJ','SH')(14秒)
select count(*) from record where date >'' and date < '' and amount >2000 (26秒)
select date,sum(amount) from record group by date(27秒)
select count(*) from record where date >'' and place in ('BJ, 'SH')(< 1秒)
select count(*) from record where date >'' and date < '' and amount >2000(< 1秒)
select date,sum(amount) from record group by date(11秒)
select count(*) from record where date >'' and place in ('BJ','SH')(< 1秒)
select sum(a.amount) from account a,card b where a.card_no = b.card_no(20秒) select sum(a.amount) from account a,card b where a.card_no = b.card_no and a.account_no=b.account_no(< 1秒)
select * from record wheresubstring(card_no,1,4)=''(13秒) select * from record whereamount/30< 1000(11秒) select * from record whereconvert(char(10),date,112)=''(10秒)
select * from record where card_no like'5378%'(< 1秒) select * from record where amount< 1000*30(< 1秒) select * from record where date= '1999/12/01'(< 1秒)
create proc count_stuff asdeclare @a intdeclare @b intdeclare @c intdeclare @d char(10)beginselect @a=count(*) from stuff where id_no=''select @b=count(*) from stuff where id_no=''endselect @c=@a+@bselect @d=convert(char(10),@c)print @d
如何让你的SQL运行得更快的更多相关文章
- 使用QFileInfo类获取文件信息(在NTFS文件系统上,出于性能考虑,文件的所有权和权限检查在默认情况下是被禁用的,通过qt_ntfs_permission_lookup开启和操作。absolutePath()必须查询文件系统。而path()函数,可以直接作用于文件名本身,所以,path() 函数的运行会更快)
版权声明:本文为博主原创文章,未经博主允许不得转载. https://blog.csdn.net/Amnes1a/article/details/65444966QFileInfo类为我们提供了系统无 ...
- 如何让Hadoop运行得更快一些
在数据处理方面,我们发现数据输入速度一般要比的数据处理速度快很多,这种现象在大多数据领域尤为明显.随着数据不断膨胀,相应的响应时间自然要有所增加,数据处理的复杂度也在不断提高.作为一个开发者,我们自然 ...
- 如何让python程序运行得更快
原则1:不优化 原则2:不要优化那些不重要的部分(否则会降低可读性) 解决方案: 1. 使用函数,局部变量比全局变量快很多.尽量使用函数,如main() 2. 有选择性的消除属性访问. 如多用 fro ...
- SQL运行优化收藏
如何让你的SQL运行得更快(转贴) ---- 人们在使用SQL时往往会陷入一个误区,即太关注于所得的结果是否正确,而忽略了不同的实现方法之间可能存在的性能差异,这种性能差异在大型的或是复杂的数据库环境 ...
- 让Python代码更快运行的 5 种方法
不论什么语言,我们都需要注意性能优化问题,提高执行效率.选择了脚本语言就要忍受其速度,这句话在某种程度上说明了Python作为脚本语言的不足之处,那就是执行效率和性能不够亮.尽管Python从未如C和 ...
- Five things that make Go fast-渣渣翻译-让GO语言更快的5个原因
原文地址:https://dave.cheney.net/2014/06/07/five-things-that-make-go-fast 翻译放在每个小段下面 Anthony Starks has ...
- SQL运行内幕:从执行原理看调优的本质
相信大家看过无数的MySQL调优经验贴了,会告诉你各种调优手段,如: 避免 select *: join字段走索引: 慎用in和not in,用exists取代in: 避免在where子句中对字段进行 ...
- spark sql运行原理
Spark sql 对SQL语句的处理,先将SQL语句进行解析(parse)形成一个tree,然后使用Rule对Tree进行绑定,优化等处理过程,通过模式匹配对不同类型的节点采用不同操作.查询优化器是 ...
- Spring AOP监控SQL运行
对数据库连接池Proxool比較熟悉的读者,都知道Proxool能够记录SQL运行内容和时间等信息日志. 我们能够将该日志记录专门的SQL日志文件.对于查找运行特别耗时的SQL起了不小的作用. 对于一 ...
随机推荐
- Nohttp网络请求数据,Post以及Get的简单实用以及设置缓存文字的的请求
开局声明:这是基于nohttp1.0.4-include-source.jar版本写的教程 由于nohttp功能强悍,因此需要多种权限,仅仅一个联网的权限是不够的,如果只给了Internet的权限,去 ...
- zepto.1.1.6.js源码中的each方法学习笔记
each方法接受要遍历的对象和对应的回调函数作为参数,它的作用是: 1.如果要遍历的对象是类似数组的形式(以该对象的length属性值的类型是否为number类型来判断),那么就把以要遍历的对象为执行 ...
- php error_log 详解
定义和用法 error_log() 函数向服务器错误记录.文件或远程目标发送一个错误. 成功,返回 true,否则返回 false. error_log(error,type,destination, ...
- wine下汉字方块解决
1.修改字体 首先,下载一个字体,例如win下的新宋体 其次, mkdir /usr/share/fonts/windows mv simsun.ttc /usr/share/fonts/window ...
- 利用Azure Automation实现云端自动化运维(3)
Azure automation的认证方式:证书 该种方式是推荐的进行Automation认证的方式,好处在于安全性高,过期时间由自己控制,不好的地方在于大家在Windows上要生成证书比较麻烦, ...
- google浏览器翻译失败解决方案
用记事本打开 C:\Windows\System32\drivers\etc下hosts文件 在文件末尾加入如下两行 203.208.46.145 translate.google.com 203.2 ...
- 基于epoll的聊天室程序
epoll相对于poll和select这两个多路复用的I/O模型更加的高效.epoll的函数很简单,麻烦的地方在于水平触发和边沿触发. 用张图来说明下 ET(边沿)只是在状态反转时触发,比如从不可读到 ...
- Struts2安装与简单部署实例
打开http://struts.apache.org/网站,下载strut2 版本选择: Full Distribution: Struts2完整版 建议下载该项(此版包括以下4项): Example ...
- 2013Q1全球网速排名 韩国第1美国第9 中国呐?(图)
德国著名统计公司Statista,最近公布了2013 Q1季度全球互联网网速排名数据.其中,韩国以平均14.2Mbps的网速继续排名世界第一. 此外,第二至第十名的国家和地区分别为:日本(11.7 M ...
- LeeCode-Invert Binary Tree
Invert a binary tree. 4 / \ 2 7 / \ / \ 1 3 6 9 to 4 / \ 7 2 / \ / \ 9 6 3 1 /** * Definition for a ...