I am trying to determine the most efficient way to keep a user's rep_change history updated and need some guidance.
Here are a few assumptions that I am inferring from the available information:
- the key for rep_change is
post_id
anduser_id
along with an implied site id - the
on_date
field is bumped when a rep related event for thatpost_id
occurs
So, if I initialize a rep table with the user's complete rep history and save the time of the update, I can subsequently query /users/{id}/reputation
with a fromdate
equal to the last update and the results will contain all items that have had a rep change since fromdate
- even if they have been returned in a previous update.
i.e.
- post #10 got a few upvotes when created last year and was entered into my local rep table at that time.
- the past xx number of rep updates have not contained that postid
- today, someone found post #10 and upvoted it and the
on_date
andpositive_rep
are updated - the next time I query rep post #10 will be in the results and I can update the rep table using
post_id
(and user_id and contrived site_id) as key
- the key for rep_change is
post_id
anduser_id
along with an implied site id - the
on_date
field is bumped when a rep related event for thatpost_id
occurs
So, if I initialize a rep table with the user's complete rep history and save the time of the update, I can subsequently query /users/{id}/reputation
with a fromdate
equal to the last update and the results will contain all items that have had a rep change since fromdate
- even if they have been returned in a previous update.
i.e.
- post #10 got a few upvotes when created last year and was entered into my local rep table at that time.
- the past xx number of rep updates have not contained that postid
- today, someone found post #10 and upvoted it and the
on_date
andpositive_rep
are updated - the next time I query rep post #10 will be in the results and I can update the rep table using
post_id
(and user_id and contrived site_id) as key
Is this an accurate description?
No. and with clarification found in comment on accepted answer, understandably so.