
SQL 性能优化
文章平均质量分 76
envykok
这个作者很懒,什么都没留下…
展开
-
SQL Server 2008 性能测试和调优
SQL Server 2008 性能测试和调优原文 :http://space.itpub.net/16436858/viewspace-621643 为应用程序设计数据库,你要考虑你的所作所为将会对数据库的性能有什么影响先;运行数据库后,客户不断的抱怨‘应用程序(数据库)跑的慢’,你又要优化数据库和应用程序的性能。这就需要数据库性能测试和调优转载 2010-03-23 01:53:00 · 930 阅读 · 0 评论 -
Tips on Optimizing SQL Server Clustered Indexes
http://www.sql-server-performance.com/tips/clustered_indexes_p1.aspx As a rule of thumb, every table should have a clustered index. Generally, but not always, the clustered index should be on a co转载 2010-05-30 23:21:00 · 175 阅读 · 0 评论 -
SQL Server性能优化的一些技巧
SQL Server性能优化的一些技巧<br />http://it.dianping.com/database-performance-opimizing-tips.htm<br />数据库性能优化涉及到很多方面,在数据库开发时可以通过一些基本的优化技巧提高数据库的性能:<br />1.原则上为创建的每个表都建立一个主键,主键唯一标识某一行记录,用于强制表的实体完整性。SQL Server 2005 DatabaseEngine将通过为主键列创建唯一索引来强制数据的唯一性。查询中使用主键时,此索引转载 2010-06-01 00:07:00 · 194 阅读 · 0 评论 -
Performance tuning - NO.1 process (in process)
(1) sp_spaceused 'tablename'(2)find out large readsDBCC DROPCLEANBUFFERS DBCC FREEPROCCACHESET STATISTICS IO ON SET STATISTICS TIME ON(3) find out indexes spaceSELECT name,used,*FROM SysindexesWHERE id=object_id('tablename') ;(4) unused inde原创 2010-07-27 02:01:00 · 279 阅读 · 0 评论 -
tempdb对SQL Server数据库性能有何影响
tempdb对SQL Server数据库性能有何影响 http://www.ej38.com/showinfo/sql-204561.html<br />本文关键词:SQL Server 网络 相反如果访问很频繁,loading就会加重,tempdb的性能就会对整个DB产生重要的影响.优化tempdb的性能变的很重要的,尤其对于大型数据库.如果使用临时表储存大量的数据且频繁访问,考虑添加index以增加查询效率.<br /> 1.SQL Server系统数据库介绍<br /> SQL Server有四转载 2010-06-02 00:31:00 · 227 阅读 · 0 评论 -
Performance Tuning SQL Server Joins
Performance Tuning SQL Server Joinshttp://www.sql-server-performance.com/tips/tuning_joins_p1.aspx By : Brad McGeheeApr 13, 2006One of the best ways to boost JOIN performance is to limit how many rows need to be JOINed.This is especially转载 2010-06-07 12:49:00 · 252 阅读 · 0 评论 -
Eliminate the Use of Temporary Tables For HUGE Performance Gains
Eliminate the Use of Temporary Tables For HUGE Performance Gains<br />http://www.sql-server-performance.com/articles/per/derived_temp_tables_p2.aspxBy : Justin Gunther<br />May 30, 2002 <br /><br />As queries become more complex, temporary tables are used转载 2010-08-06 00:49:00 · 149 阅读 · 0 评论 -
SQL SERVER 2008 JOIN hints
<br />http://stackoverflow.com/questions/2446927/sql-server-2008-join-hints<br />Can someone please tell me why applying LOOP hints to all my queries is a bad idea. I read somewhere that a LOOP JOIN is default JOIN method for query optimiser but couldn't v转载 2010-08-06 01:14:00 · 183 阅读 · 0 评论 -
Getting blocking info in sql server 2005 and 2008 the easy way
http://blogs.microsoft.co.il/blogs/dannyr/archive/2008/10/07/getting-blocking-info-in-sql-server-2005-amp-2008-the-easy-way.aspxmanagement studio :-- connection 1 use AdventureWorks go begin tran update Person.Contact set Phone = '99999'this will upd转载 2010-08-30 10:08:00 · 250 阅读 · 0 评论 -
Performance Counter on Memoery, IO, CPU
http://www.sql-server-performance.com/tips/performance_monitor_memory_counter_p1.aspxhttp://www.sql-server-performance.com/tips/monitor_io_counters_p1.aspxhttp://www.sql-server-performance.com/tips/performance_monitor_cpu_counter_p1.aspxIssuePerformance Co转载 2010-09-05 13:38:00 · 366 阅读 · 0 评论 -
Performance Tuning - No.3 How to tuning Index
http://msdn.microsoft.com/zh-cn/magazine/cc135978.aspx#S21.Identifying Logically Fragmented Indexes-- Create required table structure only.-- Note: this SQL must be the same as in the Database loop given in the -- following step.SELECT TOP 1原创 2010-09-07 15:25:00 · 186 阅读 · 0 评论 -
How important is it to understand SQL Server Wait Statistics??
<br />http://www.orcsweb.com/blog/desiree/how-important-is-it-to-understand-sql-server-wait-statistics/<br /> <br /> <br /> <br />Tobe clear, it is very important to understand wait statistics. It is akey part of tracking down application and server r转载 2010-09-21 14:07:00 · 193 阅读 · 0 评论 -
Performance Tuning - NO.2 Execute Plan
http://www.codeproject.com/KB/database/RefactorTSQLs.aspxHowto analyze and identify the scope for improvement in your TSQLs? In an ideal world, you always prevent diseases ratherthan cure. But, in reality you just can’t prevent always. I know your te转载 2010-09-29 01:09:00 · 234 阅读 · 0 评论 -
Performance Tuning - NO.4 Diagnose database performance problems
http://www.codeproject.com/KB/database/DiagnoseProblemsSQLServer.aspxAs partof a series of articles on several data access optimization steps, thisarticle focuses on diagnosing performance problems in SQL Server.IntroductionImagine you are a doctor, or转载 2010-09-29 01:36:00 · 245 阅读 · 0 评论 -
Indexed View & NOEXPAND
Indexedviews can be created in any edition of SQL Server 2005. In SQL Server2005 Enterprise Edition, the query optimizer automatically considersthe indexed view. To use an indexed view in all other editions, theNOEXPAND table hint must be used.Refr原创 2010-09-28 01:14:00 · 481 阅读 · 0 评论 -
Inline table valued function (ITVF) and a multi-statement table valued function (MSTVF)
--http://stackoverflow.com/questions/2554333/multi-statement-table-valued-function-vs-inline-table-valued-function -- http://sqlblogcasts.com/blogs/simons/archive/2008/11/03/TSQL-Scalar-functions-are-evil-.aspx In researching Matt's comment, I have revise转载 2010-12-08 00:41:00 · 295 阅读 · 0 评论 -
blocking
-- Script returns blocking information from the sysprocesses table SELECT spid, blocked, status, waittime, waittype, waitresource, db_name(dbid) DatabaseName, cmd, hostname, loginameFR转载 2010-05-30 17:11:00 · 172 阅读 · 0 评论 -
Index Tuning
Analyzing the Execution Plan (1) 用SQL SERVER Profiler 捕获Querynote:将trace file convert to table or csvhttp://msdn.microsoft.com/en-us/library/ms188425(SQL.90).aspxUSE AdventureWorks;GOSELECT *原创 2010-05-30 17:06:00 · 175 阅读 · 0 评论 -
SQL Server:揭开隐藏数据的面纱,优化应用程序性能(上)
本文转自:http://msdn.microsoft.com/zh-cn/magazine/cc135978.aspx#S2 目录服务器等待的原因 读和写 数转载 2010-04-01 00:29:00 · 217 阅读 · 0 评论 -
SQL Server:揭开隐藏数据的面纱,优化应用程序性能(下)
常用索引循环遍历所有数据库sys.indexes DMV 是一个特定于数据库的视图。因此,联接到sys.indexes 的查询只报告针对当前数据库的结果。但是,您可以使用系统存储过程 sp_MSForEachDB遍历服务器上的所有数据库,然后提供服务器范围的结果。下面是我对这些情况所采取的做法。创建一个临时表,其所需的结构与代码主体类似。我将一个不存在的记录(obj转载 2010-04-01 00:31:00 · 271 阅读 · 0 评论 -
执行缓存以优化SQL Server的内存占用
作者:superhasty 2007-11-29 在论坛上常见有朋友抱怨,说SQL Server太吃内存了。这里笔者根据经验简单介绍一下内存相关的调优知识。首先说明一下SQLServer内存占用由哪几部分组成。SQL Server占用的内存主要由三部分组成:数据缓存(DataBuffer)、执行缓存(Procedure Cache)、以及SQL Server引擎程序。SQL转载 2010-05-05 01:03:00 · 219 阅读 · 0 评论 -
read
清空一下SQL Server已经占用的缓存dbcc freeproccache 我们看一下SQL Server缓存中所占用的查询计划:Select Count(*) CNT,sum(size_in_bytes) TotalSize From sys.dm_exec_cached_plans dbcc m原创 2010-05-05 01:04:00 · 156 阅读 · 0 评论 -
数据库设计方案经典推荐
数据库设计方案经典推荐 http://blog.youkuaiyun.com/JavaProgramers/archive/2008/01/18/2051935.aspx写有效率的SQL查询(I)大型系统的生产环境,一般情况下,我们评价一条查询是否有效率,更多的是关注逻辑IO(至于为什么,回头补一篇)。我们常说,“要建彪悍的索引”、“要写高效的SQL”,其实最终目的就是在相同结果集情况下,尽可能减少逻辑IO。1.1 where条件的列上都得有统计信息。没统计信息SQLServer就无法估算不同查询计划开销优劣,转载 2010-07-01 00:20:00 · 178 阅读 · 0 评论 -
通往性能优化的天堂-地狱 JOIN方法说明
通往性能优化的天堂-地狱 JOIN方法说明 <br /><br />前言<br /> 不管是博客园还是优快云,看到很多朋友对数据库的理解、认识还是没有突破一个瓶颈,而这个瓶颈往往只是一层窗纸,越过了你将看到一个新世界。<br /> 04、05年做项目的时候,用SQL Server2000,核心表(大部分使用频繁的关键功能每次都要用到)达到了800万数据量,很早以前查过一些相关表,有的达到了3000多万,磁盘使用的光纤盘,100G空间,转载 2010-07-02 18:22:00 · 233 阅读 · 0 评论 -
SQL memory pressure scripts
-- Breaks down buffers by object (table, index) in the buffer cache SELECT OBJECT_NAME(p.object_id) AS ObjectName, p.object_id, p.index_id, COUN转载 2010-05-10 23:39:00 · 147 阅读 · 0 评论 -
SQL 优化经典
1.http://www.sqlhacks.com/Optimize/Optimize 例子 :1)Tempdb usageSELECT CAST(DB_NAME(mstr.database_id) AS VARCHAR(24)) AS Database原创 2010-05-10 22:43:00 · 157 阅读 · 0 评论 -
Missing indexes column type(Equality_columns,Inequality_columns,included_columns)
Missing indexes column type: 1.Equality_columns2.Inequality_columns3.included_columns It basically analyzes the information stored in theplan cache by the query processor about ind原创 2010-05-10 22:59:00 · 268 阅读 · 0 评论 -
Dynamic Query (Execute or sp_executesql ) vs. static Query
<br />'Whether we should use static or dynamic SQL statements does NOT relate to an IF statement.<br />When choosing between static / dynamic SQL statements,you are suggested to use static SQL statements (usp_ListWorkOrder02)for most of the cases.原创 2010-07-14 00:57:00 · 194 阅读 · 0 评论 -
See performance gains by using indexed views in SQL Server
http://www.zdnetasia.com/see-performance-gains-by-using-indexed-views-in-sql-server-61992919.htm A view is a saved T-SQL query in SQL Server. The viewdefinition is stored by SQL Server so that i转载 2010-05-24 11:31:00 · 168 阅读 · 0 评论 -
SQL Server 2000/2005 Indexed View Performance Tuning and Optimization Tips
SQL Server 2000/2005 Indexed View Performance Tuning and Optimization Tips By : Brad McGeheeApr 04, 2007 -http://www.sql-server-performance.com/tips转载 2010-05-24 11:15:00 · 220 阅读 · 0 评论 -
Use EXIST to Speed Up SELECT DISTINCT Queries
Speed Up SELECT DISTINCT Queries By : Neil BoyleJun 30, 2002 http://www.sql-server-performance.com/articles/per/select_distinct_queries_p转载 2010-05-24 17:11:00 · 245 阅读 · 0 评论 -
C# 中使用xslt & xml
using System;using System.Collections;using System.Configuration;using System.Data;using System.Linq;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.HtmlControls;using System.Web.UI.WebControls;using System.Web.UI.WebCont原创 2010-07-22 01:11:00 · 188 阅读 · 0 评论 -
重组索引
第三步:重组索引http://www.cnblogs.com/treeyh/archive/2009/07/22/1528604.htmlhttp://blog.youkuaiyun.com/seusoftware/archive/2009/12/17/5027848.aspx好,在你的表中你创建了所有合适的索引。或,多半,索引已经被创建在数据库表中。但是,你或许没有根据您的期望获得比较好的效转载 2010-05-30 17:50:00 · 253 阅读 · 0 评论 -
SQL Server 经验 (转载)
SQL Server 经验 (转载)http://www.cnblogs.com/treeyh/archive/2007/08/06/844763.html 如果你正在负责一个基于SQL Server的项目,或者你刚刚接触SQL Server,你都有可能要面临一些数据库性能的问题,这篇文章会为你提供一些有用的指导(其中大多数也可以用于其它的DBMS)。 在这里,我不打算转载 2010-05-30 18:51:00 · 144 阅读 · 0 评论 -
SQL优化 (Microsoft SQL SERVER 2000查询优化 有感)
数据库物理优化 大表切割:垂直分割:行不常用- 例如去年,前年数据,则依据年份分成若干个小表水平分割:列不常用- 例如有些列不经常使用,则将常使用列一个表,不常用列一个表 查询优化器自己优化(自己选择先连什么) 数据库语句优化:20% 语句占了80%资源 Clustered Index原创 2010-05-30 22:00:00 · 197 阅读 · 0 评论