A low-level implementation of extendible hashing for database systems.
This method uses directories and buckets to hash data and is widely known for its
flexibility and efficiency in computing time.
For instance, you have this table of records:
ID | NAME | SURNAME | CITY |
---|---|---|---|
26 | Maria | Koronis | Hong Kong |
14 | Christoforos | Gaitanis | Tokyo |
16 | Marianna | Karvounari | Miami |
12 | Theofilos | Nikolopoulos | London |
10 | Iosif | Svingos | Tokyo |
21 | Theofilos | Michas | Athens |
17 | Giorgos | Halatsis | Munich |
If each block of memory can have only 2 records the hash file after all insertions will look like this:
The program can be run by two different main functions. This first one inserts a large number of records in a file and the second one creates and inserts records into three different files simultaneously.
test_main1:
make main1
./build/runner
test_main2:
make main2
./build/runner