Hacker News new | ask | show | jobs
by dana321 2306 days ago
Thinking about it, you would need a 64-bit value to point to the offset because of the size of the file.

But an index file of 64-bit offsets could easily be seeked to read the value of the offset based upon the first 2 or even 4 byte offset.

Though with 4 bytes, that becomes a 4 gigabyte index file! But that would probably be much faster as you only do one seek in one file, then another seek to the main file, then search a much shorter distance to the result!

If the system has enough ram, the operating system will cache the files anyway and will be pretty fast i think.

(can you tell my first job involved writing ad-hoc database systems?)