TAILIEUCHUNG - Microsoft SQL Server 2008 R2 Unleashed- P129

Microsoft SQL Server 2008 R2 Unleashed- P129: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 | 1224 CHAPTER 35 Understanding Query Optimization NOTE This estimate assumes that the data rows have not been forwarded. In a heap table when a row has been forwarded the original row location contains a pointer to the new location of the data row therefore an additional page read is required to retrieve the actual data row. The actual I O cost would be one page greater per row than the estimated I O cost for any rows that have been forwarded. When a nonclustered index is used to retrieve the data rows from a heap table with a clustered index you see a query plan similar to the one shown in Figure . Notice that in SQL Server 2008 the bookmark lookup operator is replaced by a RID lookup essentially as a join with the RIDs returned by the nonclustered index seek. FIGURE An execution plan for a nonclustered index seek against a heap table. If the table is clustered the row bookmark is the clustered key for the data row. The number of I Os to retrieve the data row depends on the depth of the clustered index tree because SQL Server has to use the clustered index to find each row. The logical I O cost of finding a row using the nonclustered index on a clustered table is therefore as follows Number of nonclustered index levels Number of leaf pages to be scanned Number of qualifying rows x Number of page reads to find a single row via the clustered index Download from Row Estimation and Index Selection 1225 For example consider a heap table with a nonclustered index on last name. Assume that the index holds 800 rows per page they re really big last names and 1 700 names are within the range you are looking for. If the index is three levels deep the estimated logical I O cost for the nonclustered index would be as follows 3 index levels 3 leaf pages 1 700 leaf rows 800 rows per page 1 700 data page reads 1 706 total logical I Os Now assume that the table has a clustered index on it and the size of the nonclustered index is the same. If the clustered

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.