sql 优化 ·· 持续更新··
来源:互联网 发布:2017 9月编程语言排行 编辑:程序博客网 时间:2024/05/26 19:20
oracle的 ::
http://www.cnblogs.com/wxj1020/archive/2008/04/27/1173638.html
sql server :
The most common thing that will make a query non-sargable is to include a field inside a function in the where clause:
SELECT ... FROM ...WHERE Year(myDate) = 2008
The SQL optimizer can't use an index on myDate, even if one exists. It will literally have to evaluate this function for every row of the table. Much better to use:
WHERE myDate >= '01-01-2008' AND myDate < '01-01-2009'
Some other examples:
Bad: Select ... WHERE isNull(FullName,'') = 'Ed Jones'Fixed: Select ... WHERE ((FullName = 'Ed Jones') OR (FullName IS NULL))Bad: Select ... WHERE SUBSTRING(DealerName,4) = 'Ford'Fixed: Select ... WHERE DealerName Like 'Ford%'Bad: Select ... WHERE DateDiff(mm,OrderDate,GetDate()) >= 30Fixed: Select ... WHERE OrderDate < DateAdd(mm,-30,GetDate())
http://www.legalsoft.com.cn/docs/968.html http://www.oschina.net/translate/performance-tuning-essentials-for-sql-server-dba
0 0
- sql 优化 ·· 持续更新··
- 代码片段 持续更新··
- 【电子基础】电子基础知识·持续更新
- SQL Server 2014 使用(持续更新中···)【目录】
- 数据结构---各种树模板 持续更新···
- SQLServer错误目录(持续更新中···)
- Python·Jupyter Notebook各种使用方法记录·持续更新
- Python·Jupyter Notebook各种使用方法记录·持续更新
- Python·Jupyter Notebook各种使用方法记录·持续更新
- Python·Jupyter Notebook各种使用方法记录·持续更新
- Python·Jupyter Notebook各种使用方法记录·持续更新
- Python·Jupyter Notebook各种使用方法记录·持续更新
- Python·Jupyter Notebook各种使用方法记录·持续更新
- Python·Jupyter Notebook各种使用方法记录·持续更新
- Python·Jupyter Notebook各种使用方法记录·持续更新
- SQL荟萃(持续更新)
- hive 优化总结 持续更新
- mysql优化小记(持续更新)
- erlang进程监控:link和monitor
- mysql++ 安装vs2008
- 在cocos2d-x中使用luajit
- delphi 十进制转十六进制
- 第24章 UDP基本原理
- sql 优化 ·· 持续更新··
- 如何恢复 git reset --hard 删除的文件
- 十大硬盘数据恢复软件
- 检查是否是以手机浏览器进入
- ios单例模式(网址)
- java设计模式
- 由于我的BoBo日志需要天气内容,所以在这里留个脚印。
- ubuntu下安装VM
- uva 11258 String Partition(DP)