hash13 - Advanced File Structures Dynamic Hashing(13...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Introduction In the previous set of notes, the basic techniques for internal hashing and external hashing were explained. For both types, the objective is to achieve key-based access to the data file in O(1) time. For external hashing, this implies a single access to secondary memory. The primary difference between internal hashing and external hashing is that internal hashing techniques assume that the entire searchable address space of the file is contained in main memory during execution, while the external techniques deal with files too large to include entirely in main memory. Therefore, in external hashing some effort is made to match the hashing technique to the underlying hardware. With external hashing the use of “buckets” is a common technique whereby a single hash address is a bucket capable of holding several records. Typically a bucket corresponds to the size of a block, which is the unit of I/O exchange and thus one block has the potential to transfer many records from secondary memory to main memory. The previous set of notes wound up with an introduction to dynamic hashing. Dynamic hashing is the solution to the problem that static hash structures have when the number of records to be stored in the file either increases very close to or beyond expectations or perhaps decreases to levels much less than anticipated. With a static structure either insufficient space is available leading to unreasonably high collision rates or too much allocated space is unutilized leading to high overhead in terms of space. With static hashed structures the solution to either of these problems is an incredibly time consuming reorganization of the hashed structure. As the file grows in size the reorganization becomes simply too costly to effect and other solutions must be employed. Thus, we entered the realm of external dynamically hashed structures which can expand and contract as required based upon the access patterns to the hashed structure. So far we have examined only the form of dynamic hashing known as dynamic hashing. In this se of notes we’ll continue with a look at two different dynamic hashing techniques called extendible hashing and linear hashing. Extendible Hashing Extendable hashing, like dynamic hashing, maintains a directory structure through which access to the main address space is directed. It is the type of this structure that differs; in dynamic hashing the directory structure is Hashing - 1 Advanced File Structures – Dynamic Hashing (13)
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
essentially a B-tree; in extendible hashing this structure is a single level array of bucket addresses. Figure 1 shows a typical extendible hashing structure. Figure 1 – Structure of an extendible hashing scheme. The directory for extendible hashing contains 2 d bucket addresses where d is called the global depth of the directory. The first d bits (MSB or high-order bits) of a hash value determine the directory entry, and the address in that directory entry corresponds to the bucket in which the corresponding records are stored.
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 12

hash13 - Advanced File Structures Dynamic Hashing(13...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online