I think that you have relatively small data set in this case. What is the reason for complexity ?
Anyway, there are two kinds of data: event data (enter/leave), status data. Why don't you just keep incremental reload for events (if needed) and always rebuild status data ?
If you strongly want to do something more intelligent, you can rebuild status data only for those persons that have new events.
the reason I make it so complex is that our database simply does not provide the data I need to display:
-> The day an employee leaves, we delete all associated data in the database - we still know he was here,
but nothing more - I cannot tell which area he worked in before he left. That data is also deleted for the past,
so someone who left virtually never belonged to any specific area ...
<-> I need to show the areas, however, because otherwise there would be no value in having that info - the objective is to identify the areas with the greatest fluctuation.
-> Partial reload would be great, but if I understand it correctly, that would not touch the personell_numbers (that would be my keyfield) which are already there, correct? - so they would keep their leaving_date of '31.12.2100' or so which they had earlier - assuming their leaving_date was not known when they joined. I need to update that with the date that they disappeared from the database.