TAILIEUCHUNG - Microsoft SQL Server 2008 R2 Unleashed- P131

Microsoft SQL Server 2008 R2 Unleashed- P131: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 | 1244 CHAPTER 35 Understanding Query Optimization FIGURE An execution plan for a merge join with a preliminary sort step. In the query in Figure the titles table is already sorted on the primary key on title_id but the rows being returned from the sales table are being returned initially in stor_id order. stor_id is the leading column in the clustered primary key on sales. The resulting rows matching the search criteria on ord_date via the clustered index scan on the sales table are then re-sorted by title_id and then the merge join is performed with the rows retrieved from the titles table. If one or more of the inputs to the merge join is not sorted and the additional sorting causes the merge join to be too expensive to perform the Query Optimizer may consider using the hash join strategy instead. Hash Joins The final and most complicated join algorithm is the hash join. The hash join is an effective join strategy for dealing with large data volumes where the inputs might not be sorted and when no useful indexes exist on your tables for performing the join. Figure illustrates a query that uses a hash join. The basic hash join algorithm involves separating the two inputs into a build input and probe input. The Query Optimizer usually attempts to assign the smaller input as the build input. The hash join scans the build input and creates a hash table. Each row from the build input is inserted into the hash table based on a hash key value which is computed. The probe input is then scanned one row at a time. A hash key value is computed for each row in the probe and the hash table is scanned for matches. The hash join is an effective join strategy when dealing with large data volumes and unsorted data inputs. In a hash join the keys that are common between the two tables are hashed into a hash bucket using the same hash function. This bucket usually starts out in memory and then moves to disk as needed. The type of hashing that occurs depends on the

TỪ KHÓA LIÊN QUAN
TÀI LIỆU MỚI ĐĂNG
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.