/Extendible-Hashing

🗃️ Implementation of extendible hashing for database systems

Primary LanguageCBSD 2-Clause "Simplified" LicenseBSD-2-Clause

🗃️ Extendible Hashing

A block level implementation of Extendible Hashing for both primary and secondary indexing in database systems.
Implementation of SQL Inner Join is also included.

A tiny database example

The next images show the hashing of the following records using both primary and secondary indexing.

ID NAME SURNAME CITY
0 Dimitrios Hardy Los Angeles
1 Gabriel Kyriakopoulos Philadelphia
2 Angelos Sheeran New Work
3 Will Jolie Milwaukee
4 Angelina Antetokounmpo London
5 Giannis Antetokounmpo Athens
6 Gabriel Rontogiannis Halifax
7 Dimitrios Smith Athens
8 Dimitrios Smith Los Angeles

Primary Indexing Extendible Hashing

Secondary Indexing Extendible Hashing

Note: The secondary hashing is performed on the Surname key, as shown in the following screenshot.

Usage

A block level library named BlockFile is given for managing the memory.
Warning! The library is only compatible with linux machines, so you must be connected to a linux machine to run this repository. In order to run primary and/or secondary extendible hashing indexing just open a terminal in the current directory and do the following:

$ make primary    # Compiles primary indexing
$ make secondary  # Compiles secondary indexing
$ make runp       # Runs primary
$ make runs       # Runs secondary

$ make clean 

Authors

*Equal contribution.