Chinaunix首页 | 论坛 | 博客
  • 博客访问: 128559
  • 博文数量: 69
  • 博客积分: 595
  • 博客等级: 中士
  • 技术积分: 670
  • 用 户 组: 普通用户
  • 注册时间: 2008-04-16 17:37
文章分类

全部博文(69)

文章存档

2017年(2)

2016年(9)

2015年(13)

2014年(30)

2012年(4)

2011年(2)

2010年(2)

2009年(5)

2008年(2)

我的朋友

分类: 数据库开发技术

2016-08-26 04:53:23

There are quite some perspectives need to keep in mind when writing SQL Queries:

1. Avoid including data type conversion in joining conditions
2. Avoid using function in joining conditions
3. Avoid using negtive joining conditions
4. Keep the joining conditions in the same data type (very critical)
5. Numerical data type faster than characters matching in joining conditions

6. Create index to improve the query performance
7. Drop index when insert if possible
8. Using Global Temporary table is faster than using CTE and Subqueries
9. Calculating should not happened in joining conditions, instead, using derived columns including the calculation

阅读(333) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~