教你50招提升ASP.NET性能(二十六):对于开发人员的数据库性能技巧
Database Performance Tips for Developers
对于开发人员的数据库性能技巧
As a developer you may or may not need to go into the database and write queries or design tables and indexes, or help determine configuration of your SQL Server systems. But if you do, these tips should help to make that a more pain free process.
作为一个开发人员你可能需要进入数据库编写查询和设计表和索引,或者帮助确定您的SQL服务器系统的配置。但是如果你这样做了,这些建议应该可以在使用过程中帮到你。
- T-SQL Tips
While much of your code may be generated, at least some of it will have to be written by hand. If you are writing some, any, or all of your T-SQL code manually, these tips will help you avoid problems.
- T-SQL小窍门
虽然大部分代码是可以被生成的,但是至少还是有部分代码不得不手写。如果你正在手动编写一些,若干,或者所有的T-SQL代码,这些提示会帮助你避免问题。
(47)SELECT * is not necessarily a bad thing, but it’s a good idea to only move the data you really need to move and only when you really need it, in order to avoid network, disk, and memory contention on your server.
招数47:
SELECT * 不一定是件坏事,但是为了在服务器上避免网络,磁盘和内存冲突,只有当你真的需要它时,移动需要的数据,这是一个好主意。
(48)For small sets of data that are infrequently updated such as lookup values, build a method of caching them in memory on your application server rather than constantly querying them in the database.
招数48:
对于更新不频繁的小数据集,比如:查找值,创建一个方法在应用服务器的内存中缓存他们而不是不断查询他们的数据库。
(49)Ensure your variables and parameters are the same data types as the columns. An implicit or explicit conversion can lead to table scans and slow performance.
招数49:
确保变量和参数都是相同的数据列类型。一个隐式或显示转换会导致表扫描和迟缓的性能。
- Index Tips
Indexing tables is not an exact science. It requires some trial and error combined with lots of testing to get things just right. Even then, the performance metrics will change over time as you add more and more data.
- 索引小窍门
索引表不是一门精确的科学。它需要一些尝试和结合错误的大量测试。即使那样,当你添加越来越多的数据,性能指标会随着时间改变。
(50)You get exactly one clustered index on a table.Ensure you have it in the right place. First choice is the most frequently accessed column, which may or may not be the primary key. Second choice is a column that structures the storage in a way that helps performance. This is a must for partitioning data.
招数50:
在一个表上得到一个完全正确的聚集索引。确保你把他放在正确的位置。第一选择是最经常访问的列,这可能或不能成为主键。第二选择是一个在某种程度有利于性能的存储结构列。对于分区数据这是必须的。
(51)Performance is enhanced when indexes are placed on columns used in WHERE, JOIN, ORDER BY, GROUP, and TOP. Always test to ensure that the index does help performance.
招数51:
当索引放置在用于WHERE,JOIN,ORDER BY,GROUP,and TOP的列时,是有利于增强性能的。总是测试确保索引是有利于性能的。
教你50招提升ASP.NET性能(二十六):对于开发人员的数据库性能技巧的更多相关文章
- 教你50招提升ASP.NET性能(十六):把问题仍给硬件而不是开发人员
(27)Throw hardware at the problem, not developers 招数27: 把问题仍给硬件而不是开发人员 As developers, we often want ...
- 教你50招提升ASP.NET性能(二):移除不用的视图引擎
(2)Remove unused View Engines 招数2: 移除不用的视图引擎 If you're an ASP.NET MVC developer, you might not know ...
- 教你50招提升ASP.NET性能(十一):避免在调试模式下运行网站
(17)Avoid running sites in debug mode 招数17: 避免在调试模式下运行网站 When it comes to ASP.NET, one of the most c ...
- 教你50招提升ASP.NET性能(七):总是在服务器端执行验证
(13)Always perform validation on the server as well 招数13: 总是在服务器端执行验证 This isn’t exactly a performan ...
- 教你50招提升ASP.NET性能(二十四):ORM小窍门
ORM TipsORM小窍门 More and more people are using Object to Relational Mapping (ORM) tools to jump the d ...
- 教你50招提升ASP.NET性能(二十一):避免使用会话状态
(39)Avoid using session state 招数39: 避免使用会话状态 Where possible, you should try and avoid using session ...
- 教你50招提升ASP.NET性能(二十):7条便利的ViewState技巧
(32)Seven handy ViewState tips 招数32: 7条便利的ViewState技巧 Every time I have to deal with a classic ASP.N ...
- 教你50招提升ASP.NET性能(十九):静态集合
(30)Static collections 招数30: 静态集合 If a collection is static, make sure it only contains the objects ...
- 教你50招提升ASP.NET性能(十八):在处理网站性能问题前,首先验证问题是否出在客户端
(29)Before tackling any website performance issue, first verify the problem isn’t on the client 招数29 ...
随机推荐
- .Net中的各种序列化
我们知道将对象的状态保持在存储媒体中,以便可以在以后重新创建精确的副本这正是数据持久化所要做的.而且,不同应用程序之间的通讯需要相互传输数据.那么序列化和反序列化正是为此而生. 序列化和反序列化 所谓 ...
- poj 3260 The Fewest Coins
// 转载自http://blog.163.com/benz_/blog/static/18684203020115721917109/算法不难看出,就是一个无限背包+多重背包.问题在于背包的范围.设 ...
- 【Java集合框架】规则集--Set
集合: Java主要支持三种: 1.规则集(Set) 用于存储一组不重复的元素 2.线性表(List) 用于存储一个由元素构成的有序集合 3.队列(Queue) 同与数据结构中的队列,存储用先进先出的 ...
- oracle归档日志增长过快处理方法
oracle归档日志一般由dml语句产生,所以增加太快应该是dml太频繁 首先查询以下每天的归档产生的情况: SELECT TRUNC(FIRST_TIME) "TIME", SU ...
- TCP/IP详解学习笔记(6)-UDP协议
1.UDP简要介绍 UDP是传输层协议,和TCP协议处于一个分层中,但是与TCP协议不同,UDP协议并不提供超时重传,出错重传等功能,也就是说其是不可靠的协议. 2.UDP协议头 2.1.UDP端口号 ...
- JAVA JDK1.5-1.9新特性
1.51.自动装箱与拆箱:2.枚举(常用来设计单例模式)3.静态导入4.可变参数5.内省 1.61.Web服务元数据2.脚本语言支持3.JTable的排序和过滤4.更简单,更强大的JAX-WS5.轻量 ...
- 两个android程序间的相互调用(apk互调)
通常我们用到的只是activity之间的互相跳转和调用,很少会用到apk级别的互相调用. 往往在一些应用上会用到,比如一个支付系统,可能会有很多的一系列的程序调用到:彩票系统.订票系统.团购网……全部 ...
- 总结mysql服务器查询慢原因与解决方法
本文针对MySQL数据库服务器查询逐渐变慢的问题, 进行分析,并提出相应的解决办法,具体的分析解决办法如下: 会经常发现开发人员查一下没用索引的语句或者没有limit n的语句,这些没语句会对数据库造 ...
- [Everyday Mathematics]20150205
设 $\phi:[k_0,\infty)\to[0,\infty)$ 是有界递减函数, 并且 $$\bex \phi(k)\leq \sex{\frac{A}{h-k}}^\al\phi(h)^\be ...
- window下版本控制工具Git 客户端安装
安装使用 1.下载msysgit http://code.google.com/p/msysgit/ 2.下载tortoisegit客户端安装 http://code.google.com/p/tor ...