It is designed that way to have the ent-id at the last position, to simplify partial application of the function when the partial-ed function describes the database at a specific time, and HOF are querying that state of the db with different ids.