7 ms·
> I do not want to show the user posts that the user has already seen. OK, so like email with a "show only new messages" filter. > more and more costly over t
by tithe 2y ago
> I do not want to show the user posts that the user has already seen.
OK, so like email with a "show only new messages" filter.
> more and more costly over time
If it's tolerable to have false positives (potentially showing a user a post that they have seen before), a Bloom filter [0] might be a good match.
If you use this structure as an index to record which posts the user has seen, then it might return a post the user has already seen before (it may answer the question "is this post ID in the set?" incorrectly), but it can for sure return a post the user has not seen before (in that it will answer "is this post
ID definitely not in the set?" correctly).
[0] https://en.wikipedia.org/wiki/Bloom_filter https://en.wikipedia.org/wiki/Bloom_filter
(Edited for clarity.)
- centum 2y agoThank you!