English 中文(简体)
SQL SQL SQL 服务器服务器快件快报性能问题
原标题:SQL Server Express performance problems

<强度启动

我有一个 SQL 服务器 Express 2008 R2 正在运行。 有10个用户使用存储程序在相同的表格中永久读/写。 他们白天和晚上都这样做 。

<强度 > 问题

The performance of the Stored Procedures is getting lower and lower with increasing database size. A Stored Procedure call needs avg 10ms when the database size is about 200MB. The same call needs avg 200ms when the database size is about 3GB. So we have to cleanup the database once a month.

我们已经对一些具有积极效果的表格进行了指数优化,但问题仍然存在。

终于不是SQL服务器专家了 能给我一些提示吗?

最佳回答

SQL 服务器快递编辑限制 ( 1GB 内存缓冲池, 仅使用一个套接式 CPU, 10GB 数据库大小) 不太可能成为问题。 应用程序设计、 错误查询、 过度锁定货币和指数化差更可能是问题。 相关文章( 特别是第一篇) 包括了如何识别瓶颈的方法 。

问题回答

这很可能是程序员的错误,

  • Non proper indexing on some tables. THis is NOT optimization - bad indices is like broken HTML for web people, if you have no index then basically you are not using SQL as it is supposed to be used, you should always have proper indexes.
  • Not enough hardware, such as RAM. yes, it can manage a 10gb database, but if your hot set (the suff accessed all the time) is 2gb and you have only 1gb it WILL hit disc more often than it needs.
  • Slow discs, particularly a express problem because most people do not bother to get a proper disc layout. THen they run a sQL database againnst a slow 200 IOPS end user disc where - depending on need - a SQL database wants MANY spindles or an SSD (typical SSD these days has 40.000 IOPS).

这就是结尾处 - 加上可能非常糟糕的 SQL 。 典型过滤错误: 某些fomula( field) 类似值, 意思是“ 忘记索引, 请在检查前先扫描表格, 计算格式( field) ” 。

首先, SQL 服务器 Express 并不是您再处理的最佳版本 。 获得开发者版来测试它。 它和 Enterprises 完全一样, 但如果您不使用“ 制作”, 也可以免费 。

关于业绩,这里涉及很多事情, 你可以改进它使用, 因为索引直到分割。 我们需要更多信息来提供帮助

在优化 SQL 查询之前, 您需要找到查询的热点。 通常您可以在 SQL 服务器上使用 SQL 配置程序来这样做。 对于 Express 版本, 没有这样的工具。 但是, 您可以使用几个查询来走动 :

返回全部反转查询:

SELECT *
FROM sys.dm_exec_query_stats order by total_worker_time DESC;

只返回最费时的查询:

SELECT total_worker_time, execution_count, last_worker_time, dest.TEXT
FROM sys.dm_exec_query_stats AS deqs
CROSS APPLY sys.dm_exec_sql_text(deqs.sql_handle) AS dest
ORDER BY total_worker_time DESC;

现在您应该知道需要优化哪个查询 。

可能指数差,数据库设计差,可能不适用正常化、不受欢迎的栏目指数,以及需要大量时间执行的低质查询。





相关问题
What to look for in performance analyzer in VS 2008

What to look for in performance analyzer in VS 2008 I am using VS Team system and got the performance wizard and reports going. What benchmarks/process do I use? There is a lot of stuff in the ...

SQL Table Size And Query Performance

We have a number of items coming in from a web service; each item containing an unknown number of properties. We are storing them in a database with the following Schema. Items - ItemID - ...

How to speed up Visual Studio 2008? Add more resources?

I m using Visual Studio 2008 (with the latest service pack) I also have ReSharper 4.5 installed. ReSharper Code analysis/ scan is turned off. OS: Windows 7 Enterprise Edition It takes me a long time ...

Manually implementing high performance algorithms in .NET

As a learning experience I recently tried implementing Quicksort with 3 way partitioning in C#. Apart from needing to add an extra range check on the left/right variables before the recursive call, ...

How do I profile `paster serve` s startup time?

Python s paster serve app.ini is taking longer than I would like to be ready for the first request. I know how to profile requests with middleware, but how do I profile the initialization time? I ...

热门标签