Oddbean new post about | logout
 Here’s a visual way to get a sense of filter optimization in the local relay model. See quoted post for motivation.

Once you define the is_subset function you just call this for each filter on every other filter. This creates an array of true/false for each filter. This is equivalent to there being an arrow above each filter in the diagram. then you just remove each filter if the value is true for that index. Simple!

Adding this to the nostrdb api, might come in handy for anyone implementing the local relay model. https://i.nostr.build/8PuntrZ2ak6yvHND.jpg  nostr:note183q8djwxueg2qq9gpqv5vgrt5cgnle4pg9vv3qde48und7822r2s4ff9p5