Added automatic sequence id caching in memory