educative.io

Hash reduces the key space to a size that can be listed?

What does the line “hash reduces the key space to a size that can be listed” mean?
I read this as a part of composite partitioning.
Also how hash+list can be considered as composite partitioning?
Could you illustrate these with examples please?
Thanks!

Hi Sriram,

Thank you for reaching out to us and giving your feedback. We’ll get back to you soon!

If you have any further concerns/questions/comments, please let us know.

Best regards,
Educative Team

The basic idea of composite partitioning is that we will first partitioning the table and then each partition will be sub-partitioned. In case of hash+list, we will first partition the table by hashing and then subpartition each partition by list. For example, suppose you are creating a table to store all addresses in india. You can do hashing (though i am not sure which DBMS would allow you to provide own hashing function) and say each postal code results in a number between 0 and 9. For example postal code of Delhi would fall in hash code 0 and hence partition_0. But the same can happen for postal code of Kolkata. In this case, you further do a sub-partition with list and assign delhi postal code to DELHI and Kolkata to KOL via list.
hope i made sense.

2 Likes