English 中文(简体)
RowVersion and Performance
原标题:RowVersion and Performance

我很想知道,在Sql-Server数据库表格中增加一个rowvert栏是否对业绩产生影响?

最佳回答

业绩影响不大,转播只是旧时段数据类型的新名称。 因此,您的数据库将需要储存更多的双向领域。 如果你试图就这一数据提问,如:

SELECT *
FROM MyTable
WHERE rowVersion > @rowVersion

Which is the common way that can be used to get the list of updated items since last @rowVersion. This looks fine and will work perfect for a table with say 10,000 rows. But when you get to 1M rows you will quickly discover that it has always been doing a tablescan and your performance hit is because your table now no longer fits entirely within the RAM of the server.

This is the common problem that is encountered with the rowVersion column, it is not magically indexed on it s own. Also, when you index a rowVersion column you have to accept that the index will often get very fragmented over time, because the new updated values are always going to be at the bottom of the index, leaving gaps throughout the index as you update existing items.

Edit: 如果您不再使用rowVersion 检查更新项目的领域,而由您重新加以使用,以确保记录自您上读以来不断更新,从而成为完全可接受的用途,不会产生影响。

UPDATE MyTable SET MyField =   @myField
WHERE Key = @key AND rowVersion = @rowVersion
问题回答

暂无回答




相关问题
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 ...

热门标签