TAILIEUCHUNG - Database systems concepts 4th edition phần 6

Giả sử mà chúng ta thấy rằng giá trị này tìm kiếm chính là Ki. Chúng tôi sau đó làm theo Pi con trỏ đến một nút khác. Nếu chúng ta tìm thấy không có giá trị như vậy, sau đó k ≥ Km-1, trong đó m là số lượng các con trỏ trong một nút. Trong trường hợp này chúng tôi theo Pm sang một nút khác. Nút, chúng tôi đến ở trên, một lần nữa chúng tôi tìm kiếm các giá trị tìm kiếm chìa khóa nhỏ nhất lớn hơn. | Silberschatz-Korth-Sudarshan Database System Concepts Fourth Edition IV. Data Storage and Querying 12. Indexing and Hashing The McGraw-Hill Companies 2001 456 Chapter 12 Indexing and Hashing Figure B -tree for account file with n 5. Queries on B -Trees Let us consider how we process queries on a B -tree. Suppose that we wish to find all records with a search-key value of V. Figure presents pseudocode for doing so. Intuitively the procedure works as follows. First we examine the root node looking for the smallest search-key value greater than V. Suppose that we find that this search-key value is Kị. We then follow pointer Pi to another node. If we find no such value then k Km-1 where m is the number of pointers in the node. In this case we follow Pm to another node. In the node we reached above again we look for the smallest search-key value greater than V and once again follow the corresponding pointer as above. Eventually we reach a leaf node. At the leaf node if we find searchkey value Ki equals V then pointer Pi directs us to the desired record or bucket. If the value V is not found in the leaf node no record with key value V exists. Thus in processing a query we traverse a path in the tree from the root to some leaf node. If there are K search-key values in the file the path is no longer than rioểrn 21 K In practice only a few nodes need to be accessed Typically a node is made to be the same size as a disk block which is typically 4 kilobytes. With a search-key size of 12 bytes and a disk-pointer size of 8 bytes n is around 200. Even with a more conservative estimate of 32 bytes for the search-key size n is around 100. With n 100 if we have 1 million search-key values in the file a lookup requires only procedure find m we V set C root node while C is not a leaf node begin Let Ki smallest search-key value if any greater than V if there is no such value then begin Let m the number of pointers in the node set C node pointed to by Pm end else set

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.