If it fits the usecase, you can use a VFS SQLite so the process will just pull the needed ranges from storage.