TAILIEUCHUNG - Microsoft SQL Server 2008 R2 Unleashed- P126

Microsoft SQL Server 2008 R2 Unleashed- P126:SQL Server 2005 provided a number of significant new features and enhancements over what was available in SQL Server 2000. This is not too surprising considering there was a five-year gap between these major SQL Server 2008 is not as much of a quantum leap forward from SQL Server 2005 | 1194 CHAPTER 34 Data Structures Indexes and Performance In addition the functions in the computed column must be deterministic. A deterministic function is one that returns the same result every time it is called with the same set of input parameters. When you create a clustered index on a computed column it is no longer a virtual column in the table. The computed value for the column is stored in the data rows of the table. If you create a nonclustered index on a computed column the computed value is stored in the nonclustered index rows but not in the data rows unless you also have a clustered index on the computed column. Be aware of the overhead involved with indexes on computed columns. Updates to the columns that the computed columns are based on result in updates to the index on the computed column as well. Indexes on computed columns can be useful when you need an index on large character fields. As discussed earlier the smaller an index the more efficient it is. You could create a computed column on the large character field by using the CHECKSUM function. CHECKSUM generates a 4-byte integer that is relatively unique for character strings but not absolutely unique. Different character strings can generate the same checksum so when searching against the checksum you need to include the character string as an additional search argument to ensure that you are matching the right row. The benefit is that you can create an index on the 4-byte integer generated by the CHECKSUM that can be used to search against the character string instead of having to create an index on the large character column itself. Listing shows an example of applying this solution. LISTING Using an Index on a Computed Checksum Column --The first statement is used to disable any previously created --DDL triggers in the database which would prevent creating a new constraint. DISABLE TRIGGER ALL ON DATABASE go -- First add the computed column to the table alter table titles add .

TỪ KHÓA LIÊN QUAN
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.