Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Hash files?

Hash files?

Hash files?


I am quiet new to the theory of database, I am just started to read about it. And now i have got this question that I don’t find an easy answer for in my book (Database systems, a practical approach to design, implementation and managment).

And since I found this site, I am trying my luck here hopefully to get some answers.

I have got this information and questions:

There is this information about a key-transformed (hash-file) file:

-The transformation-key are the field "code" (two digits).
- The domain for this field is two uppercase letters from the english alphabet.
- The maximum number of posts in the file is 30.
- Fixed post-lenght.
- Number of buckets = 17.
- Fill-factor = 60% +- 10%.
- Owerflow are to be placed in the next available space.


a) How many posts must each bucket take?
(are this so simple that I just divide 30 on 17?)

b) What does this mean:
The transformation are based on the ASCII-table, addition and MOD-function?
(is this so simple that I just find the bit-code for the two letters from the ASCII-table for instance A would be 1000001, and if the code is AA I just adds this two values 1000001+1000001 = 10000010 and this is the address to the bucket?)

What would the result be if I reorganize the file to:

- Max number of posts = 50
- Number of buckets = 15 and owerflow-area = 3 buckets
- The rest is the same as above

c) What would the new block (bucket) size be?

Anyone who can give me an easy answer on these questions?
And may be some links to web-pages where I can find some answers to my questions.


Kind regard Stig

RE: Hash files?

Question a)

(30/0,6)/17 is the corect. You will need 2,94~3 posts pr bucket.

Question b)

Correct AA => 1000001+1000001 = 10000010 => 130
130 MOD 17(17 buckets) will give you this result:

130/17 = 7,647....
(7,647... -7)*17 = 11

The keyvalue AA goes in to Bucket 17 (if there is some free space).

And you just do the same with the rese of the questions.

Hope this where some help for you.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close