TAILIEUCHUNG - Microsoft SQL Server 2008 R2 Unleashed- P125

Microsoft SQL Server 2008 R2 Unleashed- P125: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 | 1184 CHAPTER 34 Data Structures Indexes and Performance Index Design Guidelines SQL Server indexes are mostly transparent to end users and T-SQL developers. Indexes are typically not specified in queries unless you use table hints to force the Query Optimizer to use a particular index. Although forcing indexes is generally not advised using Query Optimizer table hints is covered in more detail in Chapter 35. Normally based on the index key histogram or density values the SQL Server cost-based Query Optimizer automatically chooses the index that is least expensive from an I O standpoint. Chapter 35 goes into greater detail on how the Query Optimizer estimates I O and determines the most efficient query plan. In the meantime the following are some of the main guidelines to follow in creating useful indexes that the Query Optimizer can use effectively For composite indexes try to keep the more selective columns leftmost in the index. The first element in the index should be the most unique if possible and index column order in general should be from most to least unique. However remember that selectivity doesn t help if the first ordered index column is not specified in your SARGs or join clauses. To ensure that the index is used for the largest number of queries be sure the first ordered column is the column used most often in your queries. Be sure to index columns used in joins. Joins are processed inefficiently if no index on the column s is specified in a join. Remember that a PRIMARY KEY constraint automatically creates an index on a column but a FOREIGN KEY constraint does not. You should create indexes on your foreign key columns if your queries commonly join between the primary key and foreign key tables. Tailor your indexes for your most critical queries and transactions. You cannot index for every possible query that might be run against your tables. However your applications will perform better if you can identify your critical and most frequently executed

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.