Speed up by storing all entries by ID.