Unfortunately, the database query could turn out very inefficient and I did not manage to find a way to improve that. Furthermore, there were still behavior inconsistencies between fetching the timeline from Redis and fetching it from Postgres.