Reuse removed space in database file #27

Open
opened 2023-11-16 18:53:08 +01:00 by Jef Roosens · 0 comments

The index file contains a list of all valid blocks inside the database file. From this list, we can also derive a list of free blocks, which could be reused when writing new data to the database file. This would prevent the database file from growing indefinitely. This information can be tracked in-memory using e.g. a linked list.

For the idx file, we can use a similar but more simple approach, as the entries are of a constant length. We can simply overwrite entries with length 0 with new entries that are useful.

The index file contains a list of all valid blocks inside the database file. From this list, we can also derive a list of free blocks, which could be reused when writing new data to the database file. This would prevent the database file from growing indefinitely. This information can be tracked in-memory using e.g. a linked list. For the idx file, we can use a similar but more simple approach, as the entries are of a constant length. We can simply overwrite entries with length 0 with new entries that are useful.
Jef Roosens added the
Kind/Enhancement
label 2023-11-16 18:53:08 +01:00
Jef Roosens added the
Project/Lander
label 2024-08-26 10:42:18 +02:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Chewing_Bever/lander#27
There is no content yet.