Reuse removed space in database file #27
Labels
No labels
Kind/Bug
Kind/Enhancement
Kind/Feature
Project/Lander
Project/Landerctl
idea
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: Chewing_Bever/lander#27
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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.